
On Fri, Jun 3, 2011 at 04:29, Jeff Flinn <Jeffrey.Flinn@gmail.com> wrote:
Are both the parent/child process application code yours?
Yes.
We accomplish something similar by using asio with async socket communication between the parent and child processes effectively sending an exit code. If the either dies the socket closure manifests as an asio failure. We have a single thread with an asio io_service run. But that single thread can handle multiple connections to multiple child processes.
The project is currently paused but that was what I began to implement, using another library for networking (RakNet). Not sure if it provide an equivalent but if it don't I can still use boost::asio just to do this. So if you tell me it's a safe enough way to handle it using this approach (I don't feel confident in the communication domain so I'm never sure...yet), as I have the source code of both processes, I guess I'll continue on this way.
IIRC, the async wait of the previous process library would effectively work the same way, without needing socket communication, and a single thread with the io_service:run call to handle multiple child communication.
As a game you most likely have a gui application. At boostcon Chris Kolhoff suggested that you could call, IIRC, io_service::poll from your event loop to avoid a second thread.
That's a good idea, I'll see if I can use it that way. Joël Lamotte