[Xcb] [libpthread-stubs] fix semaphore signal safety

Samuel Thibault samuel.thibault at ens-lyon.org
Sat Sep 26 10:01:28 PDT 2009


Jamey Sharp, le Sat 26 Sep 2009 09:27:31 -0700, a écrit :
> I should have said it differently. If somebody expects the semaphore
> functions to do something, they should link with the appropriate
> platform implementation of those functions, whether that's in pthreads
> or elsewhere. We shouldn't be trying to semi-portably duplicate that
> functionality in pthread-stubs.

It will help when somebody wants to use semaphores but doesn't want to
carry the pthread-safe overhead of the pthread library on OSes where the
semaphore are actually in the pthread library.

> An alternative question: If the semaphore functions aren't related to
> pthreads, why are we adding them to pthread-stubs?

Because some OSes provide the semaphores in libpthread.

Anyway.  Either apply my second patch, or drop the semaphore stuff
entirely.  I've had a hard week, I don't want to fight again this
week-end.

> p.s. I just spent 30 seconds imagining a POSIX-portable
> filesystem-based implementation of inter-process semaphores. It was
> frightening.

Sure.  Without a portable inter-process synchronizing function like
futexes you can't really imagine any sane solution.

Samuel


More information about the Xcb mailing list