Path: utzoo!utgpu!watserv1!watmath!att!dptg!ulysses!andante!mit-eddie!wuarchive!zaphod.mps.ohio-state.edu!ub!rutgers!cbmvax!ken From: ken@cbmvax.commodore.com (Ken Farinsky - CATS) Newsgroups: comp.sys.amiga Subject: Re: Programmer needs advice on multitasking... Message-ID: <16088@cbmvax.commodore.com> Date: 27 Nov 90 16:30:18 GMT References: <37127@nigel.ee.udel.edu> Reply-To: ken@cbmvax.commodore.com (Ken Farinsky - CATS) Organization: Commodore, West Chester, PA Lines: 47 In article <37127@nigel.ee.udel.edu> pcooper%luke.eecs.WSU.EDU%cs2.cs.WSU.EDU@yoda.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: > > [ ...brilliant code removed... ] > > I would like to set up func_1 and func_2 to run as completely independent >processes... > > Phil There is a very well written article about this subject in AmigaMail, the article is by Mike Sinz, and is called "Creating Multiple Processes with Re-entrant Code" (AmigaMail, Nov/Dec 1989) If you are interested in back-issues of AmigaMail, a subscription to AmigaMail, or becomming a Certified or Commercial Developer, write to the following address for information: CATS Admin 1200 Wilson Drive West Chester, PA 19380 If you are developing software for the Amiga, and are not a developer, you are missing out on a lot of good technical information. The basic information in the article is: 1. Use CreateProc() to start a new process. 2. CreateProc() takes a BPTR to a seglist, so you have to create a fake seglist which points to the function that you wish to turn into a process. 3. You can use the message port in the process structure for syncronization between the two processes. I would recommend getting the whole article. Under 2.0, you can use CreateNewProc() to do the same thing without the fake seglist. -- -- Ken Farinsky - CATS - (215) 431-9421 - Commodore Business Machines uucp: ken@cbmvax.commodore.com or ...{uunet,rutgers}!cbmvax!ken bix: kfarinsky