[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua fork concurrent processes
- From: Alexandre Erwin Ittner <alexandre@...>
- Date: Mon, 5 Nov 2012 08:19:55 -0200
"ms2008vip" <ms2008vip@gmail.com> wrote
> Has anybody any experience (or advice / where we should look) with this? or give me a sample? Thanks
You can use the Good Old Unix Way: pipe() + fcntl() + fork() + dup2() +
execve(), all provided by Lua-posix. The basic idea is described in [1]
and you can read the data with posix.read() and may also need a poll()
loop if you want to multiplex the readings. I wrote something like this
sometime ago, but I have no code at hand now.
[1] http://stackoverflow.com/questions/1735781/non-blocking-pipe-using-popen
--
Alexandre Erwin Ittner - alexandre@ittner.com.br
OpenPGP pubkey 0x0041A1FB @ http://pgp.mit.edu