[Bug nptl/21119] Unify the pthread_mutex_t definitions
triegel at redhat dot com
sourceware-bugzilla@sourceware.org
Tue Feb 21 11:23:00 GMT 2017
https://sourceware.org/bugzilla/show_bug.cgi?id=21119
--- Comment #5 from Torvald Riegel <triegel at redhat dot com> ---
(In reply to Howard Chu from comment #4)
> (In reply to Torvald Riegel from comment #3)
> > I don't that a exposing futexes would be the right approach. It is too
> > low-level an interface for many clients, I believe. While currently,
> > pthreads mutexes will accomplish a lot through use of futexes, this isn't
> > necessarily going to remain that way to the same extent.
> >
> > Howard, have you tried using semaphores more extensively?
> >
> > Regarding 32b/64b compatibility: Maybe this can be considered for something
> > like a semaphore; but even there this is not quite trivial.
>
> We have support for semaphores but they're not the preferred solution.
> Mainly because there are race conditions in creating them when multiple
> processes open the DB at the same time. Also because they have an
> independent lifetime; with pshared mutexes living in the mmap'd lockfile
> they simply go away if a user decides to delete the files.
What I was referring to is using semaphores instead of mutexes: start out with
one token available, consume a token when entering a criticla section, post a
token when exiting the critical section. Same lifetime as a mutex. But
semaphores are simpler than POSIX mutexes, so perhaps it may be easier for
implementations to make stronger guarantees for them.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list