The layout of PID & PORT in the ERTS
来源:互联网 发布:海信h168网络42寸彩电 编辑:程序博客网 时间:2024/06/05 06:36
转载请注明,来自:http://blog.csdn.net/skyman_2001
我在调试erts时发现PID和PORT ID在底层是个整型,但是在erlang层的表示是<A.B.C>和#Port<A.B>的格式,它们之间是怎么转换的呢?通过grep发现在erts/emulator/beam/erl_term.h里有关于PID和PORT的layout说明,这里只谈论本节点情况下的layout:
* PID layout (internal pids):
|3 3 2 2 2 2 2 2|2 2 2 2 1 1 1 1|1 1 1 1 1 1 | |
|1 0 9 8 7 6 5 4|3 2 1 0 9 8 7 6|5 4 3 2 1 0 9 8|7 6 5 4 3 2 1 0|
| | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|n n n n n n n n n n n n n n n n n n n n n n n n n n n n|0 0|1 1|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
n : number
* PORT layout (internal ports):
|3 3 2 2 2 2 2 2|2 2 2 2 1 1 1 1|1 1 1 1 1 1 | |
|1 0 9 8 7 6 5 4|3 2 1 0 9 8 7 6|5 4 3 2 1 0 9 8|7 6 5 4 3 2 1 0|
| | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|n n n n n n n n n n n n n n n n n n n n n n n n n n n n|0 1|1 1|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
n : number
示例:
1. pid为3683,二进制表示为111001100011,去掉tag,则为11100110,换算成十进制则为230,则外部表示则为<0.230.0>;
2. port id为61111,二进制表示为1110111010110111,去掉tag,则为111011101011,换算成十进制则为3819,则外部表示则为#Port<0.3819>。
- The layout of PID & PORT in the ERTS
- the port already in used
- Changing the layout direction of a form item in Flex
- Through the PID find the execution of the SQL
- Catch the port number of an Url
- how to change the port of tomcat
- Change the port number in WAS 8.5
- The differences between alternate port and backup port in RSTP
- pid=1010_Tempter of the Bone
- what's the function of pid file?
- What is the meaning of xmlns:tools in Android XML layout?
- @" and "+" in the Android layout file
- The process that WPF determine the layout of UIelements
- print the layout of the structure with graphic bar
- In the exotic view of the city
- the bug of the module in flex3
- the tables of the user in SAP
- Code in the Language of the Domain
- 4188. 进制转换
- PHP网站页面静态化的生成方法介绍
- INTEL处理器识别和CPUID指令(二) CPUID指令
- 如何获取Activity的根视图
- Android中程序与Service交互的方式——综述
- The layout of PID & PORT in the ERTS
- 哥写了一件艺术品
- Android中程序与Service交互的方式——交互方式
- java高新技术开发实战重点总结
- 图形开发之cairo库的编译
- 3980. 二进制转十进制
- win7下Documents and Settings拒绝访问的解决方法
- {嵌入式stm32}之关于GPIO的输入输出
- 面试题开发实战