From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20816 invoked by alias); 20 Sep 2012 11:05:46 -0000 Received: (qmail 20692 invoked by uid 48); 20 Sep 2012 11:05:22 -0000 From: "mihaylov.mihail at gmail dot com" To: glibc-bugs@sources.redhat.com Subject: [Bug nptl/13165] pthread_cond_wait() can consume a signal that was sent before it started waiting Date: Thu, 20 Sep 2012 11:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: nptl X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mihaylov.mihail at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: drepper.fsp at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2012-09/txt/msg00180.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13165 --- Comment #21 from Mihail Mihaylov 2012-09-20 11:05:21 UTC --- (In reply to comment #20) > The standard indeed doesn't talk about the "future". It doesn't make a sort of > lower-bound requirement on which threads have to be considered blocked, but no > upper bound. If you think there's an upper bound, please point the requirement > in the standard. If there is no required upper bound, it's up to the > implementation how to deal with that. "The pthread_cond_broadcast() and pthread_cond_signal() functions shall have no effect if there are no threads currently blocked on cond." How about this as an upper bound? If implementations are allowed to determine the set of blocked threads at any point in time they see fit, there would be no way to define "currently blocked" at all and this sentence couldn't make any sense. And also: ".... however, if predictable scheduling behavior is required, then that mutex shall be locked by the thread calling pthread_cond_broadcast() or pthread_cond_signal()." If I accept your argument, there will be no way to determine at least a set of threads from which the woken thread will be chosen, so why does the standard talk about predictability? -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.