[haiku] Re: Any plans for pthread support?

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Tue, 22 Sep 2009 14:31:23 -0400

On Tue, Sep 22, 2009 at 2:10 PM, Roland Plüss <roland@xxxxxxx> wrote:
>
> Now it is possible I didn't get the implementation in Haiku but right now it
> looks to me that this semaphore implementation is like an ordinary mutex
> without condition support and that the posix compatibility layer simply
> emulates a condition variable using semaphores.

Yes we implement condition variables using semaphores, which is not
"emulation", it is just one way to implement them. As Bruno implied
semaphores are a lower level thread primitive that can be used to
build higher level constructs such as condition variables, read-write
locks, queues, etc. I wrote the original pthread condition variable
implementation, which was improved by Ingo (who knows his stuff.)

Now we do actually have kernel land condition variables too, which
might be implemented more directly, but I suspect they too are built
on lower level constructs.

-- 
Regards,
Ryan

Other related posts: