From owner-freebsd-current Fri Sep 25 11:36:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA16699 for freebsd-current-outgoing; Fri, 25 Sep 1998 11:36:42 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp2.erols.com (smtp2.erols.com [207.172.3.235]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA16693 for ; Fri, 25 Sep 1998 11:36:33 -0700 (PDT) (envelope-from shmit@natasya.noc.erols.net) Received: from natasya.noc.erols.net (natasya.noc.erols.net [207.172.25.236]) by smtp2.erols.com (8.8.8/8.8.5) with ESMTP id OAA00315 for ; Fri, 25 Sep 1998 14:36:28 -0400 (EDT) Received: (from shmit@localhost) by natasya.noc.erols.net (8.9.1/8.9.1) id OAA03000 for current@freebsd.org; Fri, 25 Sep 1998 14:36:22 -0400 (EDT) Message-ID: <19980925143621.E262@kublai.com> Date: Fri, 25 Sep 1998 14:36:21 -0400 From: Brian Cully To: current@FreeBSD.ORG Subject: Pthreads, signals, fork, and me. Reply-To: shmit@kublai.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i 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'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 ``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