Date: Mon, 09 Jul 2001 02:28:47 -0700 From: Julian Elischer <julian@elischer.org> To: Jason Evans <jasone@canonware.com> Cc: arch@freebsd.org Subject: Re: help needed in threads.. (Signals) Message-ID: <3B49794F.5123170F@elischer.org> References: <3B494657.D3B7BF48@elischer.org> <20010708232131.O8775@canonware.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Jason Evans wrote: > > 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. here's where I'm having problems... I can pass the signal to the UTS, but I don't know what to do about the threads that are doing 'uninterruptable sleeps' in the kernel. Should the UTS give me back a list of threads to kick? that would satisfy the posix semantics. I guess I should ignore all signals when in KSE mode and just pass them up as an upcall. (The kernel interface and the user interface need not be the same). This indicates that a signal pre-empts whatever is running to do an upcall rather than waiting until i gets a chance that may never happen. (hmmmmm I need to think about this more... off to bed..) > > Bwahaha. > > Jason -- +------------------------------------+ ______ _ __ | __--_|\ Julian Elischer | \ U \/ / hard at work in | / \ julian@elischer.org +------>x USA \ a very strange | ( OZ ) \___ ___ | country ! +- X_.---._/ presently in San Francisco \_/ \\ v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B49794F.5123170F>