Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!olivea!oliveb!isc-br!hawk!rsami!rick From: rick@rsami.UUCP (Rick Schaeffer) Newsgroups: comp.sys.amiga.tech Subject: Re: Need a few pointers :-) Message-ID: Date: 3 Dec 90 21:29:02 GMT References: <9011241137.AA24447@luke.eecs.wsu.edu> Sender: root@hawk.isc-br.com (Rick Schaeffer) Lines: 31 >In article <9011241137.AA24447@luke.eecs.wsu.edu> pcooper@LUKE.EECS.WSU.EDU (Phil Cooper - CS495) writes: >Fellow Amigans: > > I would like some advice/examples on how to set up several functions >in a source code file as independent processes (using ports and messages >for inter-process communications.) My problem can be described as follows: > > Phil You might take a look at the popen example I posted to alt.sources.amiga a while back. The 2.0 version of it uses the new CreateNewProc() function which can optionally create an entire process out of a function within the current process. I use that feature to start the background part of the pipe. If you don't yet have access to Dos2.0, there was an example of exactly what you want posted a long time ago. It was called "proc.c" and illustrated how to create a process out of a function by using the old CreateProc() function. This function takes a pointer to a "seglist"...well a seglist simply consists of a pointer to the next segment followed by the actual code to be executed. What he did was to stuff a "jmp" instruction into a dummy seglist structure, set the address of the jump to the function address, and then call CreateProc() passing a pointer to this dummy seglist. Hopefully, this is enough to get you going. If not, I can probably dig up the source code and email it to you. If you decide to email to me, be sure to use the address in my .signature. My news site is my amiga and it isn't a registered site! -- Rick Schaeffer UUCP: uunet!isc-br.isc-br.com!ricks E. 13611 26th Ave. ricks@isc-br.isc-br.com Spokane, Wa. 99216 Phone: (509)928-3533