[comp.sys.amiga.tech] Does anyone have a code example for CreateProc function of AmigaDos?

rickf@pnet02.cts.com (Rick Flower) (07/03/89)

I'm working on a program that needs the ability to spawn 8 different tasks
(well, ok, processes!) and use the least amount of memory as possible.  What I
thought that I would do is LoadSeg the actual program that needs to be spawned
8 times and then CreateProc() the same code 8 times.  I think it will work, as
long as I make the program that was LoadSeg'd allocate the memory it needs
instead of using assembly time data areas.  Perhaps this will also not work?
I don't know at this point, but I'm basically looking for some code that shows
examples of the CreateProc function and how it will interact with the parent
process, in either Assembly or "C"...

Thanks in Advance..

+-----------------------------------------------------------------------------+
|               Caution, Assembly Language Programmer at Play!                |
|                                                                             |
|             UUCP: {ames!elroy, <backbone>}!gryphon!pnet02!rickf             |
|             INET: rickf@pnet02.cts.com                                      |
+=============================================================================+

jesup@cbmvax.UUCP (Randell Jesup) (07/04/89)

In article <17336@gryphon.COM> rickf@pnet02.cts.com (Rick Flower) writes:
>I'm working on a program that needs the ability to spawn 8 different tasks
>(well, ok, processes!) and use the least amount of memory as possible.  What I
>thought that I would do is LoadSeg the actual program that needs to be spawned
>8 times and then CreateProc() the same code 8 times.  I think it will work, as
>long as I make the program that was LoadSeg'd allocate the memory it needs
>instead of using assembly time data areas.  Perhaps this will also not work?
>I don't know at this point, but I'm basically looking for some code that shows
>examples of the CreateProc function and how it will interact with the parent
>process, in either Assembly or "C"...

	What you want will work, so long as you don't use any globals, unless
they're referenced like you would in a "pure" program - in an allocated data
area via a base register.  Lattice cres.o startup module does this automatically
when linked into a program.

	
-- 
Randell Jesup, Keeper of AmigaDos, Commodore Engineering.
{uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com  BIX: rjesup  
Common phrase heard at Amiga Devcon '89: "It's in there!"