home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cbmvax!jesup
- From: jesup@cbmvax.commodore.com (Randell Jesup)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: How to program multi-threaded programs on Amiga ?
- Message-ID: <36778@cbmvax.commodore.com>
- Date: 6 Nov 92 22:18:40 GMT
- References: <36604@cbmvax.commodore.com> <RNlXr*DG7@garfield.fipnet.fi>
- Reply-To: jesup@cbmvax.commodore.com (Randell Jesup)
- Organization: Commodore, West Chester, PA
- Lines: 33
-
- vsaari@garfield.fipnet.fi (Ville Saari) writes:
- >Randell Jesup (jesup@cbmvax.commodore.com) wrote:
- >: It's farily easy to start a subroutine as a process under 2.0 using
- >: CreateNewProc() with NP_Entry. There are a few things to watch out for
- >: (setting up global data pointers, and handling of library bases), but it's
- >: pretty easy. Make sure the sub-process exits before the main process!
-
- >What is the right way for sub-process to exit and how can the main process
- >be absolutely sure the sub-process has exited?
-
- There are any number of ways. Most of them some sort of notification
- combined with Forbid(). For example:
-
- void
- myproc ()
- {
- ...
- Forbid();
- Signal(parent,sig); // tell parent we exited
- }
-
- The Forbid() is needed to ensure that the parent doesn't unload
- before the child finishes exiting (think about the case of the parent having
- higher priority to understand why).
-
- You can also use messages, or shared global variables, etc, etc.
-
- --
- To be or not to be = 0xff
- -
- Randell Jesup, Jack-of-quite-a-few-trades, Commodore Engineering.
- {uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com BIX: rjesup
- Disclaimer: Nothing I say is anything other than my personal opinion.
-