Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!riley From: riley@batcomputer.tn.cornell.edu (Daniel S. Riley) Newsgroups: comp.sys.amiga.tech Subject: Re: Process vs Task Message-ID: <7752@batcomputer.tn.cornell.edu> Date: 15 Apr 89 15:00:37 GMT References: <8459@polya.Stanford.EDU> <5279@cs.Buffalo.EDU> Reply-To: riley@tcgould.tn.cornell.edu (Daniel S. Riley) Organization: Cornell Theory Center, Cornell University, Ithaca NY Lines: 33 In article <5279@cs.Buffalo.EDU> ugkamins@sunybcs.UUCP (John Kaminski) writes: >Also, aren't there only 20 process slots? Or are >those only processes that are CLI's? Or is there no difference in THOSE two? I believe that's 20 CLI slots, and there is a difference between a CLI and a process. I probably have more than 20 processes on my Amiga right now, and only 5 or 6 of them are CLIs. >Around the LoadSeg() problem: One could conceivably AllocMem() for new process >space then use a memory copying routine to clone the needed parts, and finding >the address of the stuff to copy via FindTask(0) and "peeking into" the struct >that is pointed to by the results obtained from that call. Hmmmm....this >method has some definite possibilities for emulating fork(). I thought about this before recommending LoadSeg and seglist splitting to Kari. If you have no global references in your code, then this should be workable. Just drop the allocated memory into the tc_MemEntry list, and have the finalPC code RemTask(0) (I think that's right). You can't just use the normal process cleanup unless you turn the allocated memory into a proper seglist (I think). If your code has global data accessed as an offset from a register ("small data model"), you should be able to copy the data segment and fix the address register of the new task. This may require some knowledge of the seglist structure, but it must be doable, since Lattice's startup code for resident modules does this. If the code has absolute references, then you can't do it in general, though specific cases might be workable. Of course, most of this has been hashed out on the net many times before, but I was just a cub Amiga programmer then... -Dan Riley (riley@tcgould.tn.cornell.edu, cornell!batcomputer!riley) -Wilson Lab, Cornell U.