On Wed, 21 Feb 2007, William James wrote:

One of 'em.  It's not documented.

Only one of them or any number of them?

I sense a misunderstanding there.

UNIX signals are nothing like the messaging mechanism that e.g. the GTK+ and QT libraries use and call 'signals'.

A "signalable messaging mechanism" for multithreaded applications are condition variables. See condition(5). These are more likely what you're looking for ?

UNIX signals are _NOT_ made for letting threads within a multithreaded process synchronize with each other.

UNIX signal are cross-process, IPC (interprocess communication) mechanisms.

Just like you don't use shared memory for multiple threads in one process (because the address space is shared to start with), you don't use UNIX signals for multiple threads in one process. They're not made for that, they're not suitable for that.



You can control which threads can process signals, though.  Just set
the signal mask.

You mean I can turn off signal handling in all threads except the main
one which then sends the signal to all others?

You don't send UNIX signals within a process. You send them cross-process, or (and that these days is the thing that matters) the operating system sends them to your process in case of error - that'll give a synchronous signal such as SIGFPE, SIGBUS, SIGSEGV, which will usually terminate your process.

FrankH.
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to