From owner-freebsd-threads@FreeBSD.ORG Tue Nov 4 14:40:04 2008 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0694B1065674 for ; Tue, 4 Nov 2008 14:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E937B8FC12 for ; Tue, 4 Nov 2008 14:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4Ee3D7084491 for ; Tue, 4 Nov 2008 14:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id mA4Ee31J084489; Tue, 4 Nov 2008 14:40:03 GMT (envelope-from gnats) Date: Tue, 4 Nov 2008 14:40:03 GMT Message-Id: <200811041440.mA4Ee31J084489@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Ed Maste Cc: Subject: Re: threads/128180: pthread_cond_broadcast(3) lost wakeup X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ed Maste List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 14:40:04 -0000 The following reply was made to PR threads/128180; it has been noted by GNATS. From: Ed Maste To: bug-followup@FreeBSD.org, kurt@intricatesoftware.com Cc: Subject: Re: threads/128180: pthread_cond_broadcast(3) lost wakeup Date: Tue, 4 Nov 2008 09:09:38 -0500 > The test program doesn't look correct to me. It seems possible > for only a few of the threads (as little as 2) to do all the > work. Thread 1 can start doing work, then wait for a broadcast. > Thread 2 can start doing his work, then broadcast waking thread 1. It looks to me like the "tickets" and "finished" globals should make the test program operate correctly. If the scenario you describe happens, thread 1 will just enter pthread_cond_wait again and wait for the broadcast from the primordial thread.