From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5810 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: bug in pthread_cond_broadcast Date: Tue, 12 Aug 2014 17:20:13 -0400 Message-ID: <20140812212013.GD12888@brightrain.aerifal.cx> References: <1407801532.15134.96.camel@eris.loria.fr> <20140812165033.GM22308@port70.net> <20140812171941.GA12888@brightrain.aerifal.cx> <1407867539.15134.148.camel@eris.loria.fr> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1407878434 27219 80.91.229.3 (12 Aug 2014 21:20:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Aug 2014 21:20:34 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5816-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 12 23:20:28 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XHJUX-0002zG-Sq for gllmg-musl@plane.gmane.org; Tue, 12 Aug 2014 23:20:26 +0200 Original-Received: (qmail 3623 invoked by uid 550); 12 Aug 2014 21:20:25 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3611 invoked from network); 12 Aug 2014 21:20:25 -0000 Content-Disposition: inline In-Reply-To: <1407867539.15134.148.camel@eris.loria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5810 Archived-At: On Tue, Aug 12, 2014 at 08:18:59PM +0200, Jens Gustedt wrote: > Am Dienstag, den 12.08.2014, 13:19 -0400 schrieb Rich Felker: > > Once broadcast returns (as observed by the thread which called > > broadcast, or any thread that synchronizes with this thread after > > broadcast returns), there are no waiters and it's valid to use a new > > mutex with the cond var (or destroy it if it won't be used again). > > all the clients can only wakeup on holding their mutex, which in turn > is only released by the main thread after it returns from the > broadcast operation. > > so yes, the broadcast operation is synchronized with all other > threads, that's the idea of this test OK, thanks for clarifying. I'm still trying to understand where the error in musl's accounting is happening -- I'd like to find a fix that would be acceptable in the 1.0.x branch and make that fix before possibly re-doing the cond var implementation (a fix which wouldn't be suitable for backporting). Rich