From owner-freebsd-current Thu Aug 6 13:16:35 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA18632 for freebsd-current-outgoing; Thu, 6 Aug 1998 13:16:35 -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 NAA18574 for ; Thu, 6 Aug 1998 13:16:20 -0700 (PDT) (envelope-from shmit@coleridge.kublai.com) Received: (from shmit@localhost) by coleridge.kublai.com (8.8.8/8.8.8) id QAA12266; Thu, 6 Aug 1998 16:15:56 -0400 (EDT) (envelope-from shmit) Message-ID: <19980806161553.44240@kublai.com> Date: Thu, 6 Aug 1998 16:15:53 -0400 From: Brian Cully To: "Daniel M. Eischen" Cc: freebsd-current@FreeBSD.ORG Subject: Re: Pthreads woes revisited. Reply-To: shmit@kublai.com Mail-Followup-To: "Daniel M. Eischen" , freebsd-current@FreeBSD.ORG References: <35C9ED3D.41C67EA6@vigrid.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89i In-Reply-To: <35C9ED3D.41C67EA6@vigrid.com>; from Daniel M. Eischen on Thu, Aug 06, 1998 at 01:51:57PM -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 01:51:57PM -0400, Daniel M. Eischen wrote: > But your not yielding the CPU after the pthread_cond_signal(). > The waiter thread (thr_wait) should also take the mutex lock (busy) > before the pthread_cond_wait(). See the comments in the revised > copy of your code. >From what I can tell by looking at uthread_mutex.c:pthread_mutex_unlock() and uthread_cond.c:pthread_cond_wait(), I don't have to lock the mutex before calling pthread_cond_wait(). Regardless, I tried adding the extra pthread_mutex_lock() call, and things still fail in the same manner. Moreover, the fact that the location of the sleep() call makes a difference points to something more sinister. -bjc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message