Date: Fri, 25 Sep 1998 14:36:21 -0400 From: Brian Cully <shmit@kublai.com> To: current@FreeBSD.ORG Subject: Pthreads, signals, fork, and me. Message-ID: <19980925143621.E262@kublai.com>
next in thread | raw e-mail | index | archive | help
I've a strange problem I'm having with some threading code I'm writing on my FreeBSD box. Basically, I have a process that goes daemonic, blocks all signals, spawns a bunch of threads, and then the main thread hangs out polling the results of sigwait() for something interesting. The problem is that I never see anything interesting, I cannot, for the life of me figure out how to get sigwait() to ever return. It just sleeps. The interesting thing is that if I don't become a daemon, sigwait() does the right thing. Has any one heard of symptoms like that? Also, I have a couple of questions that aren't answered by the ORA Pthreads book: * Can I use sigprocmask() instead of pthread_signal()? It appears that you can with FreeBSD, but I don't know if it's POSIX. * Are signal handlers supposed to get called even if you are doing a sigwait() for that particular signal? Suffice it to say, I'm fairly new to this pthreads thing (though not threading in general), and the ORA book leaves a lot to be desired. Is there another book I can grab that explains pthreads any better? An URL? Thanks. -- Brian Cully <shmit@rcn.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?19980925143621.E262>