Subj : Re: pthread_sigmask in single thread application To : comp.programming.threads From : ptjm Date : Wed Jan 05 2005 05:38 am In article , Giancarlo Niccolai wrote: % In a multithread program, the best choice is probably that of dedicate one % thread to receive all signals I agree with this. % 3) in the monitor thread: accept all the signals you wish to handle. % 4) wait forever on a condition variable that will never be signaled... But not this. It's much simpler to leave the signals blocked and use sigwait(). % from the signal handler, many things are unsafe to do including locking % mutexes. This means that you should NOT lock mutexes from signal handler; Which is another reason why you should use sigwait() instead. % This however arises another problem (uhm...): a signal may arrive AFTER you % have enabled signals and BEFORE you are waiting on the condition. Or perhaps this is why you should use sigwait() instead. -- Patrick TJ McPhee North York Canada ptjm@interlog.com .