From owner-freebsd-hackers Mon Nov 20 16:34:52 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id QAA29512 for hackers-outgoing; Mon, 20 Nov 1995 16:34:52 -0800 Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id QAA29498 for ; Mon, 20 Nov 1995 16:34:49 -0800 Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id RAA02606; Mon, 20 Nov 1995 17:32:13 -0700 From: Terry Lambert Message-Id: <199511210032.RAA02606@phaeton.artisoft.com> Subject: Re: int type in jmpbuf To: cimaxp1!jb@werple.net.au (John Birrell) Date: Mon, 20 Nov 1995 17:32:13 -0700 (MST) Cc: terry@lambert.org, hackers@FreeBSD.org, jb@cimlogic.com.au In-Reply-To: <199511202306.KAA22555@werple.net.au> from "John Birrell" at Nov 21, 95 10:10:53 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 989 Sender: owner-hackers@FreeBSD.org Precedence: bulk > > Actually, the occurance of a signal condittion give you the _opportunity_ > > to set a flag. > > But not necessarily an opportunity to _check_ the flag. > > > > > Then you check the flag on a blocking call *not* in the signal handler > > before actually making the call to decide to do the context switch, and > > the problem goes away. > > But if the running thread is not about to do any blocking calls, then it > can only be preempted by making a decision in the signal handler. The signal > handler has to perform the context switch. How else can we time slice between > two threads each doing while(1); ?? Shoot the programmer. 8-). Seriously, nothing requires that the scheduling of threads be preemptive. If you need it, you should add a system call (like SunOS has) to save and restore register state, including the FP registers. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.