Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!crdgw1!pookie!barnettj From: barnettj@pookie.crd.ge.com (Janet A Barnett) Newsgroups: comp.sys.amiga.programmer Subject: Re: Intuition beginner's problem Summary: A lot depends on your compiler Keywords: multitasking intuition Message-ID: <17930@crdgw1.crd.ge.com> Date: 27 Mar 91 01:54:39 GMT References: <1511@tau.sm.luth.se> Sender: news@crdgw1.crd.ge.com Distribution: comp Organization: General Electric Corporate R&D Center Lines: 19 In article <1511@tau.sm.luth.se> d89-rbn@sm.luth.se (Robert Buren) writes: > >I'm learning how to use multitasking in my programs, but I seem to have >run into a problem here. The method of spinning off a task from a loaded program depends heavily on the compiler you are using. If you have a late model SAS/C compiler, be sure to use the -y option so that the Global data pointer is reloaded into register a4 when your "subroutine" is invoked. (Since the spawned task executes in a different context from the parent task, there is no guarentee that this register is still pointing to the global data area.) Oh, you can also declare your routine as: void __saveds routinename(); (or possibly __saveds void routinename()) then you don't have to have every routine do the a4 reload. I do not know what facilities other C compilers may provide for this kind of thing. AB