Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!well!ewhac
From: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab)
Newsgroups: comp.sys.amiga
Subject: Re: Spawning tasks which draw . . .
Message-ID: <4696@well.UUCP>
Date: 11 Dec 87 00:52:58 GMT
References: <8712081929.AA17657@cory.Berkeley.EDU>
Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab)
Organization: Wonka Reality Factory
Lines: 48

In article <8712081929.AA17657@cory.Berkeley.EDU> dillon@CORY.BERKELEY.EDU (Matt Dillon) writes:
>	Parent spawns child at low priority
>	Child runs
>	Parent wants to kill child:
>	    Parent sends child a prearranged signal and increases child's
>	     priority.  Parent then Waits for a reply.
>	    Child sends Parent a prearranged signal when it is ready to die
>	    Child does a Wait(0).
>	    Parent kills child. (rather than child kills itself).
>
	A more general (and better, in my opinion) way to go about this is
as follows:
-------
		PARENT				CHILD
	Parent sends kill signal to
	 child.
	Parent waits for reply.
					Child receives kill signal.
					Child cleans up anything it
					 allocated.
					Child Forbid()s.
					Child replies signal.
					Child waits for Godot (Wait (0L)).
	Parent receives reply.
	Parent RemTask()s child.
-------
	For AmigaDOS processes, the procedure is slightly different:
-------
		PARENT				CHILD
	Parent sends kill signal to
	 child.
	Parent waits for reply.
					Child receives kill signal.
					Child cleans up anything it
					 allocated.
					Child Forbid()s.
					Child replies signal.
					Child **exits**.  This preserves
					 DOS's sanity.
	Parent receives reply.
	Parent **UnloadSeg()s** child.
--------
	Comments?

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape	ihnp4!ptsfa -\
 \_ -_		Recumbent Bikes:	      dual ---> !{well,unicom}!ewhac
O----^o	      The Only Way To Fly.	      hplabs / (pronounced "AE-wack")
"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor