From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12180 invoked by alias); 5 Dec 2014 20:30:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 12170 invoked by uid 89); 5 Dec 2014 20:30:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,RDNS_DYNAMIC,TVD_RCVD_IP autolearn=no version=3.3.2 X-HELO: brightrain.aerifal.cx Date: Fri, 05 Dec 2014 20:30:00 -0000 From: Rich Felker To: libc-alpha@sourceware.org Subject: Re: [PATCH 0/3] Fix semaphore destruction (BZ #12674) Message-ID: <20141205203031.GV4574@brightrain.aerifal.cx> References: <1417804668.22797.108.camel@triegel.csb> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1417804668.22797.108.camel@triegel.csb> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-12/txt/msg00163.txt.bz2 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