[omniORB] Thread implementations on different OS

Sai-Lai Lo S.Lo@orl.co.uk
Thu, 16 Apr 1998 16:15:34 +0100


Hi Henrik,

>>>>> Henrik Schulz writes:

> because of portability reasons, I would like to use the same thread,
> mutex, ... interfaces | implementation e.g. posix threads,...
> on NT as well as on solaris or wherever. If this is possible, are there
> any constraints to do this? I'd be interested in using pthreads, pmutex,
> ....

I think you are better off using omnithread in your code because it is a
small collection of wrapper classes created exactly for the reason of
providing portability across multiple platforms. The wrapper classes are
very pthread-like. If you are familiar with conditional variables and
mutexes you should have no problem using the library.

There is one limitation with omnithread which has been raised in recent
postings. Basically, it is OK for an omnithread instance to call into the
primitives of the native thread system. The reverse is not true. For
instance, it is an error for a thread created using the native thread
system to call into omnithread primitives such as omnithread::join().
Saroj Mahapatra posted a message earlier on the subject and proposed a
change to the NT implementation omni_condition. We haven't got around to
look at it yet. May be someone could help by looking at this issue on *all*
platforms and work out a solution without changing the API.


Sai-Lai