From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31433 invoked by alias); 20 Sep 2012 12:29:01 -0000 Received: (qmail 31303 invoked by uid 48); 20 Sep 2012 12:28:37 -0000 From: "triegel at redhat dot com" To: glibc-bugs@sources.redhat.com Subject: [Bug nptl/12875] pthread_cond_timedwait can steal the wakeup of slower thread in pthread_cond_wait Date: Thu, 20 Sep 2012 12:29: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: triegel at redhat dot com X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org 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/msg00183.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12875 --- Comment #14 from Torvald Riegel 2012-09-20 12:28:36 UTC --- (In reply to comment #13) > > It says that those have blocked, not that those are exactly the ones that can > > be considered to have blocked (i.e., the first "if" in what you quoted is an > > "if", not an "iff" (if and only if)). > > Short of an implementation-defined extension that must be documented, there is > no way a waiter can block on a condition variable short of calling > pthread_cond_wait or pthread_cond_timedwait. Under your proposed > interpretation, pthread_cond_signal would be useless; It's not useless. It just doesn't give all the guarantees you thought it would give. > in order to be useful, at > least one thread needs to unblock, and the application has to be able to know > (based on its knowledge of which threads have blocked) that the signal will > unblock a thread that will allow the program to make forward progress. If the application needs to associate certain waiters with signalers, it can just use a separate cond var for this, for example. -- 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.