Luaproc is one of the multi-thread implementation for Lua. Compared with other lua multi-thread implementation, it provides several interesting features. See this paper: http://www.inf.puc-rio.br/~roberto/docs/ry08-05.pdf , which is written by the big names of Lua commnunity.
Recently, I want to rewrite the multi-thread module for one of my project to support the distribution computation. After considering several lua multi-task implementation ( LuaTask, luaproc, lane etc ), I decided to use luaproc as the base to build my module. However, I found that luaproc do not provide the interfaces to manage the life cycle of lua processes. After calling luaproc.newproc(), the only thing I can do is waiting for its end. I even can not identify a process, because there is no identifier for lua process. Since the management of process life cycle is very important for my module, I modified luaproc to support these requirements. Two new functions were added to both of the parent process and child process.
luaproc.id() returns the id of the running lua process. Process id is a number from 0 to 4096.
luaproc.exist(<id>) finds out whether there exists a process with the given process id.
The original luaproc.newproc() function now returns a process id for further usage.
<process id> luaproc.newproc()
This might be useful for those who want to customize luaproc. The source code can be found at the following link:
It is under the same license as luaproc