2009 March 30th Monday (三月 三十日 月曜日)
来源:互联网 发布:华宇软件 基金会 编辑:程序博客网 时间:2024/04/19 17:36
Erlang supports change of code in a running system. Code replacement is done on module level.
The code of a module can exist in two variants in a system: current and old. When a module is loaded into the system for the first time, the code
becomes 'current'. If then a new instance of the module is loaded, the code of the previous instance becomes 'old' and the new instance becomes 'current'.
Both old and current code is valid, and may be evaluated concurrently. Fully qualified function calls always refer to current code. Old code may stil
be evaluated because of processes lingering in the old code.
If a third instance of the module is loaded, the code server will remove (purge) the old code and any processes lingering in it will be terminated.
Then the third instance becomes 'current' and the previously current code becomes 'old'.
To change from old code to current code, a process must make a fully qualified function call. Example:
-module(m).
-export([loop/0]).
loop() ->
receive
code_switch ->
m:loop();
Msg ->
...
loop()
end.
To make the process change code, send the message code_switch to it. The process then will make a fully qualified call to m:loop() and change to
current code. Note that m:loop/0 must be exported.
For code replacement of funs to work, the tuple syntax {Module,FunctionName} must be used to represent the fun.
Code Loading
The object code must be loaded into the Erlang runtime system. This is handled by the code server.
The code server loads code according to a code loading strategy which is either interactive (default) or embedded. In interactive mode, code are
searched for in a code path and loaded when first referenced. In embedded mode, code is loaded at start-up according to a boot script.
- 2009 March 30th Monday (三月 三十日 月曜日)
- 2008 March 31th Monday (三月 三十一日 月曜日)
- March 5th Monday (三月 五日 月曜日)
- 2008 March 10th Monday (三月 十日 月曜日)
- 2009 March 9th Monday (三月 九日 月曜日)
- 2009 March 16th Monday (三月 十六日 月曜日)
- 2009 March 23th Monday (三月 二十三日 月曜日)
- March 12th Monday (三月 十二日 月曜日)
- March 19th Monday (三月 十九日 月曜日)
- 2009 March 2nd Monday (三月 二日 月曜日)
- 2008 March 24th Monday (三月 二十四日 月曜日)
- March 26th Monday (三月 二十六日 月曜日)
- 2008 March 17th Monday (三月 十七日 月曜日)
- Aprial 30th Monday (四月 三十日 月曜日)
- July 30th Monday (七月 三十日 月曜日)
- 2008 March 3td Monday (三月 三日 月曜日)
- 2009 March 31th Tuesday (三月 三十一日 火曜日)
- 2009 March 4th Wednesday (三月 四日 水曜日)
- 2009 March 26th Thursday (三月 二十六日 木曜日)
- ubuntu中的快捷键
- 2009 March 27th Friday (三月 二十七日 金曜日)
- Linux 常用C函数说明-接口处理篇(1)
- 无线module WIFI+BLUETOOTH 推荐
- 2009 March 30th Monday (三月 三十日 月曜日)
- Linux 常用C函数说明-接口处理篇(2)
- 2009 March 31th Tuesday (三月 三十一日 火曜日)
- Linux 常用C函数说明-接口处理篇(3)
- 各行业潜规则
- MFC获取本地IP地址
- Linux 常用C函数说明-接口处理篇(4)
- C语言头文件的使用
- ubuntu字体及乱码