22 Nov
2007
22 Nov
'07
6:38 a.m.
On Thu, Nov 22, 2007 at 01:56:59AM +0100, Fabian Sturm wrote:
A well I guess I wasn't expressing good enough. I look for a nice solution where thread B is completely independent of A. But A waits for B doing some work.
Use a message queue..
inform_thread_A ();
This would send a message to A through the message queue, and A would check at convenient times whether a message has arrived. Optionally, you can send a signal (on POSIX) to thread A to make it immediately notice that there's a message. POSIX message queues can be configured to do that for you automatically.