[omniORB] Single Thread Policy

Duncan Grisby dgrisby@uk.research.att.com
Mon, 09 Oct 2000 14:07:42 +0100


On Monday 9 October, David Riddoch wrote:

> You probably want to put mutex locks round accesses to the thread-unsafe
> library.

Further to what David says, you may be wondering how to do this if
your main thread is blocked in the library's event loop. The usual way
is to somehow post a message to the main thread, telling it to leave
the event loop. You can often do this on Unix by creating a pipe, and
telling the event loop to listen on the pipe as well as whatever else
it's doing. Then you can put some data in the pipe to wake the main
thread up. After that, it's easy to use mutexes to let other threads
access the library.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --