[omniORB] porting omnithread to beos.

Nicolas Fischer nick@f3c.com
Mon, 26 Nov 2001 20:24:11 +0100


Hello,

In an attempt to port omniORB to beos, I'm currently porting the omnithread
 abstraction layer (beos has no pthreads)

I'm having some problems with this, maybe someone can help me.

------------- 1. condition implementation in posix.cc

I wrote a little omnithreads test application to test my beos-impl. I also
 compiled this on a linux (2.4) machine to compare and noticed that a timedwait on a
 condition would always return 0 even if there is no broadcast() or signal()
 taking place on the condition. The docu states that it should return ETIMEDOUT.
Look at line 174 of posix.cc:

>    if (rc =3D=3D ETIMEDOUT)
>	return 0;

should I implement according to documentation or should I implement the
 bugs=3F=3F

-------------- 2. condition broadcast not working correctly

According to documentation a broadcast() on a condition should signal all
 threads waiting on the condition. The posix implementation seems to trigger only one
 thread. (my other test-thread waiting on the same condition is not affected)

-------------- 3. nameclt doesn't terminate with my thread-implementation

when I run nameclt for example, it doesn't terminate. This is of course a
 problem with my omnithreads implementation.
Maybe someone can give me a hint on where the problem might be.
this output I get (lots of debugging, the "flatland/" context is correct, using
 a name-service on a remote machine)

>[nick@zapp nameclt]$ ./nameclt list
>omni=5Fthread::init: beos thread impl by nick@f3c.com initializing, you have a
 version (of libomnithreads) with compiled-in debugging
>initial thread 4927
>start=5Fundetached
>start=5Fundetached
>omni=5Fthread=5Fwrapper: thread 1 starting
>running undetached 1 run=5Fundetached()
>omni=5Fthread=5Fwrapper: thread 2 starting
>running undetached 2 run=5Fundetached()
>flatland/
>done, destroying orb

then it just hangs there with 3 threads active... there seems to be no exit()
 call on the threads. the run=5Fundetached() functions do not return.
How are the threads killed=3F
I assume the two additional threads (apart from the main thread) are part of
 the ORB and should be killed or exit themselves when the ORB is destroyed
 (orb-destroy() is called, as the last debug-line which I inserted in nameclt.cc
 indicates)

--------------

A test suite for omni-threads would come in real handy. Does something like
 that exist=3F

looking forward to some hints,
nick