[omniORB] porting omnithread to beos.

Duncan Grisby dgrisby@uk.research.att.com
Tue, 27 Nov 2001 12:42:22 +0000


On Monday 26 November, "Nicolas Fischer" wrote:

> 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.

The documentation is wrong, I'm afraid. The comments in omnithread.h
are correct, and that's what the implementations match. I'll update
the documentation.

> 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)

broadcast() should indeed wake all the threads up. It works fine in
several places in omniORB. Are you sure both your threads are actually
waiting at the time you broadcast?

> when I run nameclt for example, it doesn't terminate. This is of course a
>  problem with my omnithreads implementation.

Have you implemented broadcast() so it wakes up all waiting threads?
If not, that might be the problem.

[...]
> 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.

Are you able to get a stack track of what the threads are doing?

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

There isn't a testsuite, but the examples in src/examples/thread
exercise quite a lot of the facilities.

Cheers,

Duncan.

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