Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!decwrl!claris!outpost.UUCP!peirce From: peirce@outpost.UUCP (Michael Peirce) Newsgroups: comp.sys.mac.system Subject: Re: True Multitasking Message-ID: <0B010004.qmnkzq@outpost.UUCP> Date: 19 Jan 91 23:38:53 GMT Reply-To: peirce@outpost.UUCP Organization: Peirce Software Lines: 32 X-Mailer: uAccess - Mac Release: 1.0.3 In article <1991Jan18.195343.6636@everexn.com>, drew@everexn.com (Drew Rogge) writes: > > In article <11745@goofy.Apple.COM> lsr@Apple.com (Larry Rosenstein) writes: > >MPW tools (including the compiler) run nicely in the background. In fact, > >it is very easy to take some generic C utility and make it run in the > >background under MPW. > > Does anyone know if there is a function that an MPW tool can call which will > yield control of the CPU for a while to give other tasks a chance to run? > I ported Dave Buck's raytracer, DKBTrace, to run as an MPW tool but the > response time of the system was horrible when it was running. The program > is very compute bound and doesn't call out to the system very often. Look in the files CursorCtl.p in the PInterfaces (or the C equivalent). The following routines are declared there: InitCursorCtl(newCursors) - Init CursorCtl to load the 'acur' resource RotateCursor(counter) - Sequence through cursor frames for counter mod 32 SpinCursor(increment) - Sequence mod 32 incrementing internal counter Hide_Cursor() - Hide the current cursor Show_Cursor(cursorKind) - Show the cursor Every time you call these routines, MPW yields CPU time too. It even handles command-. for canceling the tool execution. -- michael -- Michael Peirce -- outpost!peirce@claris.com -- Peirce Software -- Suite 301, 719 Hibiscus Place -- Macintosh Programming -- San Jose, California 95117 -- & Consulting -- (408) 244-6554, AppleLink: PEIRCE