On Jan 24, 2008 7:18 PM, The Rasterman Carsten Haitzler <[EMAIL PROTECTED]> wrote: > > now i think this is a bit more generic a solution - but it adds overhead. so > what about the pselect() method? anyone got input on that?
Basically, pselect() is designed for exactly this situation. You block all of the signals you're going to handle during init or some other very early point, then you pass a mask of the signals you're going to unblock to pselect(). At this point, pselect() will atomically unblock the specified signals and call select() with the specified fd's, it also re-instates the original signal blocks after select() returns. Since this sequence is atomic, it prevents the race condition we currently have. Now the problem, this is a good solution on BSD and Solaris, but unfortunately Linux only fakes support for pselect() (unless this was fixed recently). On Linux pselect() is actually a wrapper exactly around the sequence sigprocmask(), select() sigprocmask(). So we still end up with a race condition between the first sigprocmask() call and the select() call. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel