Path: utzoo!utgpu!watmath!att!rutgers!ucsd!helios.ee.lbl.gov!ux1.lbl.gov!beard From: beard@ux1.lbl.gov (Patrick C Beard) Newsgroups: comp.sys.mac.programmer Subject: Re: Need info on multitasking capabilities on the mac Message-ID: <4294@helios.ee.lbl.gov> Date: 27 Nov 89 00:36:31 GMT References: <6391@tank.uchicago.edu> <9072@hoptoad.uucp> Sender: usenet@helios.ee.lbl.gov Reply-To: beard@ux1.lbl.gov (Patrick C Beard) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 37 In article <9072@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: >I wonder how they do that. Can anyone provide any information? My >first thought was to schedule your file transfer protocol off the >vertical retrace manager, but your tasks don't get called when you're >switched out. Ah, but one of the Multi-Finder technotes states that vbl tasks that are in the System Heap will continue running even in other contexts. Here's how I do it: struct jump_vector { short jmp; /* place to stuff a 0x4e21 jump instruction. */ ProcPtr addr; /* the place to jump to. */ }; typedef struct jump_vector jump_vector; ... main() { jump_vector *the_jump; the_jump = (jump_vector*)NewPtrSys(sizeof(jump_vector)); ... the_jump->jmp = 0x4e21; the_jump->addr = (ProcPtr)vbl_routine; /* routine we want called. */ /* then, call VInstall with the vblAddr field of your VBLTask record set to point to the_jump... */ ... } ------------------------------------------------------------------------------- - Patrick Beard, Macintosh Programmer (beard@lbl.gov) - - Berkeley Systems, Inc. "..............Good day!" - Paul Harvey - -------------------------------------------------------------------------------