[net.micro.amiga] CORRECTION to prior posting - creating processes

robp@amiga.UUCP (Robert A. Peck) (03/26/86)

In my "MULTI-PROCESSING" posting, I made a couple of errors that should
be corrected.  

Semantics, semantics, semantics .... (sigh):
--------------------------------------------
    MULTI-PROCESSING is a term usually reserved for using multiple
    processORS rather than starting up multiple proceSSES.  Thus
    this example is multi-tasking, using multiple AmigaDOS processes.


Poor AmigaDOS won't know what to do .....
-----------------------------------------
    A more serious error was in using the message port that is allocated
    to the process as my ReplyPort for the return of the startup message.
    This is a particularly insidious problem in that AmigaDOS has set
    this message port up for a purpose, that being to receive packets
    of instructions.  If the process sleeps, waiting for an instruction
    packet to arrive, AmigaDOS may retrieve my returned startup message
    thinking it contained instructions.... BOOM!

    Here's the correct way... replacing only a line here and there:

		in proctest.c, beneath includes, ADD:
			extern struct MsgPort *CreatePort();
	
		OLD LINE:
			mainmp = &myprocess->pr_MsgPort;
		REPLACE BY:
			mainmp = CreatePort(0,0);
			/*	(should also add error checking to see 
				 if CreatePort works ok)
		 	 */
	
		THEN AFTER LINE:
			UnLoadSeg(littleSeg);
		ADD:
			DeletePort(mainmp);
			
Sorry if anybody had trouble with this one.  That port belongs to AmigaDOS.
Unless we're actually sending DOS Packets to it, we have to leave that port
alone. 


robp.