浏览 2427 次
锁定老帖子 主题:erlang driver和热部署(重要)
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2007-10-23
先看下erl_ddll的说明: The actual unloading/loading is done as one atomic operation, blocking all processes in the system from using the driver concerned while in progress. The preferred way to do driver code replacement is to let one single process keep track of the driver. When the process start, the driver is loaded. When replacement is required, the driver is reloaded. Unload is probably never done, or done when the process exits. If more than one user has a driver loaded when code replacement is demanded, the replacement cannot occur until the last "other" user has unloaded the driver. Demanding reload when a reload is already in progress is always an error. Using the high level functions, it is also an error to demand reloading when more than one user has the driver loaded. To simplify driver replacement, avoid designing your system so that more than than one user has the driver loaded. 这个回答了我许久以来困惑我的问题: 为什么erlang kernel里面的file->file_server, code->code_server这样的架构, 终于在这个时候真相大白。看来erlang比我们考虑的要周道。 有兴趣的同学可以参考下release_handling的实现,相信会对hot deployment 有很深的理解。 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |