Re: [Libevent-users] how to handle SIGCHLD before going into dispatch

2012-08-10 Thread Yee Keat Phuah
Hi Dave, On Fri, Aug 10, 2012 at 11:12 PM, Dave Hart wrote: > Your code has a race between the child and the parent. If you create > the base and install the SIGCHLD handling before forking, the race > will be cured. Thanks! That worked, I thought it was better to create the base in the parent

Re: [Libevent-users] how to handle SIGCHLD before going into dispatch

2012-08-10 Thread Dave Hart
Hi Yee, Your code has a race between the child and the parent. If you create the base and install the SIGCHLD handling before forking, the race will be cured. Cheers, Dave Hart *** To unsubscribe, send an e-mail to majord...@fre

[Libevent-users] how to handle SIGCHLD before going into dispatch

2012-08-10 Thread Yee Keat Phuah
I have a piece of code that does a fork, and the parent goes into the event_dispatch loop while the child does something. The child will exit at some point of time so I will need to attach a SIGCHLD handler into the event_base (I assume that I shouldn't be calling event_base_loopexit from a standar