From owner-freebsd-hackers Thu Apr 11 13:40:01 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id NAA09786 for hackers-outgoing; Thu, 11 Apr 1996 13:40:01 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id NAA09766 for ; Thu, 11 Apr 1996 13:39:56 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id NAA04732; Thu, 11 Apr 1996 13:36:19 -0700 From: Terry Lambert Message-Id: <199604112036.NAA04732@phaeton.artisoft.com> Subject: Re: The F_SETOWN problem.. To: hasty@rah.star-gate.com (Amancio Hasty Jr.) Date: Thu, 11 Apr 1996 13:36:19 -0700 (MST) Cc: terry@lambert.org, wong@rogerswave.ca, roell@blah.a.isar.de, hackers@FreeBSD.ORG, roell@xinside.com In-Reply-To: <199604111857.LAA02569@rah.star-gate.com> from "Amancio Hasty Jr." at Apr 11, 96 11:57:03 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > >>> Terry Lambert said: > > > > AST's are easy. It's the stacks they need to run while your program > > > > is already using your only stack that are annoying. > > Is this a problem? Lets look it at it from a different angle what happens > when the user's process stack space is exhausted-- the process dies. > > So what is wrong with allocating a fix sized stack for handling ast events? It is common to put a huge amount of code in an AST, including potentially blocking system calls and calls to start other activity that could, itself, result in an AST. Which is to say that a small fixed size stack is unacceptable. In many cases, the entire program operates in nothing but AST's -- if you have the VMS source code, look at the PHONE utility. It's common to do this in signal handlers as well, even though it's bad practice. Hell, since BSD does not virtualize interrupt handling, it's common to do with code that runs at interrupt time as well. The problem with allocating a fixed stack in these circumstances is that it's too small. AST's need to fire in a shared heap, seperate stack environment. As I said before, VMS's additional split in protection domains allows this to happen. An AST needs to be able to fire when another AST is being handled and has made a blocking call, otherwise you lock yourself out of the most useful aspects of AST's compared to signals. Since it's a DEC internal product, I don't expect you to be familiar with DEC's MTS (MultiThreading Services), but they are on the order of changing a blocking call to a call with AST plus a context switch. Like pthreads, except signals don't get screwed as a result. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.