From owner-freebsd-current Fri Aug 7 07:07:11 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA09182 for freebsd-current-outgoing; Fri, 7 Aug 1998 07:07:11 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from coleridge.kublai.com (coleridge.kublai.com [207.96.1.116]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA09171 for ; Fri, 7 Aug 1998 07:07:06 -0700 (PDT) (envelope-from shmit@coleridge.kublai.com) Received: (from shmit@localhost) by coleridge.kublai.com (8.8.8/8.8.8) id KAA20626; Fri, 7 Aug 1998 10:06:45 -0400 (EDT) (envelope-from shmit) Message-ID: <19980807100643.33286@kublai.com> Date: Fri, 7 Aug 1998 10:06:43 -0400 From: Brian Cully To: Daniel Eischen Cc: freebsd-current@FreeBSD.ORG Subject: Re: Pthreads woes revisited. Reply-To: shmit@kublai.com Mail-Followup-To: Daniel Eischen , freebsd-current@FreeBSD.ORG References: <199808062113.RAA18177@pcnet1.pcnet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89i In-Reply-To: <199808062113.RAA18177@pcnet1.pcnet.com>; from Daniel Eischen on Thu, Aug 06, 1998 at 05:13:02PM -0400 X-Sender: If your mailer pays attention to this, it's broken. X-PGP-Info: finger shmit@kublai.com for my public key. Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Aug 06, 1998 at 05:13:02PM -0400, Daniel Eischen wrote: > You're not adding the pthread_yield() call that I added after > the pthread_cond_signal(). Your program is bogus because there > is no guarantee that the main thread will release the CPU in > order for the other task to run. You need to perform some > sort of blocking operation after the pthread_cond_signal. I > chose to use pthread_yield, although sleep would work just as > well. Do'h! I missed that. That did make the sample program work, so it looks like the error was mine all along, sorry for troubling everybody. -bjc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message