[net.micro.6809] os9fork

megabyte@chinet.UUCP (Mark E. Sunderlin) (02/06/86)

Can anyone give me a clear explanation of how to use the chain()
and os9fork() calls in the microware 'C' Compiler?  One thing 
I would like to do is simulate the un*x fork() call where a program
simply clones itself.  As to chain(), how do you know when you get
ready to chain to another program what all the other program's
data,paramiter,and other needs are? ie how do you know what paramters
pass to the call? Replies by mail or net.
_________________________________________________________________________
UUCP:	(1) seismo!dolqci!irsdcp!scsnet!sunder		Mark E. Sunderlin
	(2) ihnp4!chinet!megabyte			aka Dr. Megabyte
CIS:	74026,3235					(202) 634-2529
Quote:	"No matter where you go, There you are"		   (9-4 EST)
Mail:	IRS 1111 Constitution Ave. NW  PM:S:D:NO Washington, DC 20224  
-- 
_________________________________________________________________________
UUCP:	(1) seismo!dolqci!irsdcp!scsnet!sunder		Mark E. Sunderlin
	(2) ihnp4!chinet!megabyte			aka Dr. Megabyte
CIS:	74026,3235					(202) 634-2529
Quote:	"No matter where you go, There you are"		   (9-4 EST)
Mail:	IRS 1111 Constitution Ave. NW  PM:S:D:NO Washington, DC 20224  

emjej@uokvax.UUCP (02/10/86)

You can't clone the Unix fork() with os9fork(); even if you fork a process
with the same primary module, its state isn't duplicated from that of the
parent.  Frankly, this is a good thing; the Unix fork() sucks--it requires
considerable hardware assist to avoid massive overhead (ask someone the
story behind Berserkeley's vfork() call), and is practically never used
save in a form that emulates os9fork(), i.e.

		if (fork(.) says I'm the child)
			execl(what I wanted to run in the first place);

instead of the code in the parent

		os9fork(what the child ought to run);

As for what parameters it and chain() ought to have, well, I'm afraid you
have to either know, or you can link to the module and take a peek. It 
would have been nice if the table mapping module types to how they should
be run when forked or chained to were in the kernel and tweakable, rather
than in the shell.  (While OS-9 is internally much cleaner than Unix, it's
not perfect; I'd like to think that recognition of this distinguishes us
from the Unix-worshippers.)

					James Jones