[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" <[email protected]> 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 - [email protected]
OpenPGP pubkey 0x0041A1FB @ http://pgp.mit.edu