Date: Wed, 5 Aug 1998 18:09:13 -0400 From: Brian Cully <shmit@kublai.com> To: current@FreeBSD.ORG Subject: Pthreads woes Message-ID: <19980805180913.10635@kublai.com>
next in thread | raw e-mail | index | archive | help
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 <shmit@erols.com>
``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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980805180913.10635>
