From owner-freebsd-arch Sun Jul 8 23:21:41 2001 Delivered-To: freebsd-arch@freebsd.org Received: from magnesium.net (toxic.magnesium.net [207.154.84.15]) by hub.freebsd.org (Postfix) with SMTP id C7FCD37B401 for ; Sun, 8 Jul 2001 23:21:38 -0700 (PDT) (envelope-from jasone@magnesium.net) Received: (qmail 70320 invoked by uid 1142); 9 Jul 2001 06:22:16 -0000 Date: 8 Jul 2001 23:22:15 -0700 Date: Sun, 8 Jul 2001 23:21:31 -0700 From: Jason Evans To: Julian Elischer Cc: arch@freebsd.org Subject: Re: help needed in threads.. (Signals) Message-ID: <20010708232131.O8775@canonware.com> References: <3B494657.D3B7BF48@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3B494657.D3B7BF48@elischer.org>; from julian@elischer.org on Sun, Jul 08, 2001 at 10:51:19PM -0700 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Jul 08, 2001 at 10:51:19PM -0700, Julian Elischer wrote: > Can someone tell me if an alarm() call that sets an alarm signal for > some time in the futire (in a threaded environment, has teh signal delivered > to the process (an random thread), the same thread that made the request, > or a predesignated thread.. I just can't work out > what the right way to handle it in the code is.. > > posix? Bwahaha, signals and threads. Each thread has its own signal mask. A signal sent to the process is delivered to a thread that doesn't have the signal masked (if any). If more than one thread has the signal unmasked, which thread receives the signal is undefined. That's what happens (or is supposed to happen). If you want to know the right way to do signal handling in threaded programs, that requires more explanation. Bwahaha. Jason To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message