From owner-freebsd-current Wed Aug 5 15:09:48 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA02918 for freebsd-current-outgoing; Wed, 5 Aug 1998 15:09:48 -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 PAA02913 for ; Wed, 5 Aug 1998 15:09:34 -0700 (PDT) (envelope-from shmit@natasya.kublai.com) Received: from natasya.kublai.com (natasya.kublai.com [207.172.25.236]) by coleridge.kublai.com (8.8.8/8.8.8) with ESMTP id SAA01994 for ; Wed, 5 Aug 1998 18:09:15 -0400 (EDT) (envelope-from shmit@natasya.kublai.com) Received: (from shmit@localhost) by natasya.kublai.com (8.8.8/8.8.8) id SAA10723; Wed, 5 Aug 1998 18:09:13 -0400 (EDT) Message-ID: <19980805180913.10635@kublai.com> Date: Wed, 5 Aug 1998 18:09:13 -0400 From: Brian Cully To: current@FreeBSD.ORG Subject: Pthreads woes Reply-To: shmit@kublai.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89i 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 I'm working on a program that spawns a bunch of threads in a pool, each of which sits on a condition variable. The main thread waits for a RADIUS request on a socket, it signals the condition variable on one of the threads in the pool. The sequence of events is: main ---------------------- spawn threads loop { lock thread mutex wait for packet unlock mutex send signal to thread } threads ---------------------- loop { wait for signal do RADIUS crap } The mutex in question is the same one as used by pthread_cond_wait. The problem is that I have to wake up the same thread /twice/ before it answers a request (IOW, pthread_cond_signal is called twice before the thread wakes up and `does RADIUS crap'). I haven't been able to reproduce this in something that isn't so complicated (but I can give the full source to anyone who's interested), but I was hoping someone might be able to tell me off-the-bat if it's a known problem in some instances (or that it's a problem at all). If not, I'll see what I can do to make the test simpler. -- Brian Cully ``And when one of our comrades was taken prisoner, blindfolded, hung upside-down, shot, and burned, we thought to ourselves, `These are the best experiences of our lives''' -Pathology (Joe Frank, Somewhere Out There) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message