This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 0/3] Fix semaphore destruction (BZ #12674)
- From: Rich Felker <dalias at libc dot org>
- To: libc-alpha at sourceware dot org
- Date: Fri, 5 Dec 2014 15:30:31 -0500
- Subject: Re: [PATCH 0/3] Fix semaphore destruction (BZ #12674)
- Authentication-results: sourceware.org; auth=none
- References: <1417804668 dot 22797 dot 108 dot camel at triegel dot csb>
On Fri, Dec 05, 2014 at 07:37:48PM +0100, Torvald Riegel wrote:
> This patch set fixes
> https://sourceware.org/bugzilla/show_bug.cgi?id=12674 by either using
> 64b atomic operations (where available), or by using two separate fields
> when only 32b atomic operations are available. In the latter case, we
> keep a conservative estimate of whether there are any waiting threads in
> one bit of the field that counts the number of available tokens, thus
> allowing sem_post to atomically both add a token and determine whether
> it needs to call futex_wake.
>
> The first two patches are changes to the tests, the last big patch is
> where the actual fix resides.
I haven't read the code, but per your description of the changes, the
concepts all sound correct.
Rich