[haiku-commits] Re: r33543 - in haiku/trunk: headers/private/shared src/system/libroot/os

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 12 Oct 2009 21:02:51 +0200

"Michael Lotz" <mmlr@xxxxxxxx> wrote:
> > mmlr@xxxxxxxx wrote:
> > > Everything's currently exposed in shared/private/locks.h but I
> > > think we should make these locking primitves public.
> > Why exactly would that be needed (besides convenience when sharing 
> > kernel/userland code)? There is already the pthreads API which 
> > provides similar functionality, too.
> No reason besides that I find the API quite to the point for what it 
> does, so I didn't feel like changing it.
> 
> It's just that I see benaphores implemented over and over again, so 
> providing a generic mutex would make sense IMO. I know that pthread 
> provides these parts as well, but since it is POSIX it also has POSIX 
> semantics like the return codes it uses for example. Providing some 
> sort of "native" low level locking primitives besides sems just seems 
> sensible to me. We are so focused on being multi-threaded that I find 
> it a bit strange to not provide a set of adequate primitives to 
> efficiently synchronize them.

Okay, that makes sense indeed. I'm not sure I like the API as is, 
though, especially for userland, the name flags don't make much sense, 
for example.
Maybe they can one day be made more light-weight and faster in 
userland, too.

All in all, I think I would prefer a nice C++ API for userland for 
these things, as that is our primary API.

Bye,
   Axel.


Other related posts: