🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #10641

LWPs

#10641
From: Matt Dillon
Date: Mon, 19 Dec 1988 19:25
37 lines
1708 bytes
	For those of you following my LWP postings ... I've decided to change
the semantics a bit.

	Before, the InitLWP() call would bypass the subroutine's normal
return vector and return directly to the caller.  Unfortunetly, this means
the subroutine does not restore any registers it saved on the stack so
register initialization (or declaring arguments as register variables) was
not allowed.

	Which is a bitch because you have to think about it.  My thinking
then was that the user thus not need to worry about checking InitLWP(), he
simply had:

	InitLWP()
	(rest of subroutine that is now the LWP goes here)

	NOW, I changed the name to ForkLWP() and the call works more like
fork.  There are *no* register variable restrictions and you can do whatever
you want.  One now must say:

	if (descriptor = ForkLWP(stack, arglen)) 
	    return(descriptor);
	(rest of subroutine that is now the LWP goes here)

		or (if parent doesn't need the descriptor)

	if (ForkLWP(stack, arglen))
	    return;
    
	ForkLWP returns the descriptor to the parent and 0 to the child.  I'll
be posting much revised LWP stuff in a day or two.  This actually has more 
power than InitLWP() because it allows you to 'fork' the subroutine at any
time... you can choose whether you want the parent to return or to continue
running.

					-Matt
Technical Details
Message-ID: <8812191925.AA23419@postgres.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!ucsd!ucbvax!POSTGRES.BERKELEY.EDU!dillon

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!ucsd!ucbvax!POSTGRES.BERKELEY.EDU!dillon
From: dillon@POSTGRES.BERKELEY.EDU (Matt Dillon)
Newsgroups: comp.sys.amiga.tech
Subject: LWPs
Message-ID: <8812191925.AA23419@postgres.Berkeley.EDU>
Date: 19 Dec 88 19:25:33 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Lines: 37