Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site Shasta.ARPA Path: utzoo!linus!decvax!decwrl!Glacier!Shasta!gus From: gus@Shasta.ARPA Newsgroups: net.micro.mac Subject: Re: Coroutines needed for Macintosh! Message-ID: <863@Shasta.ARPA> Date: Mon, 7-Oct-85 03:07:35 EDT Article-I.D.: Shasta.863 Posted: Mon Oct 7 03:07:35 1985 Date-Received: Wed, 9-Oct-85 03:27:50 EDT References: <96900012@uiucuxc> Organization: Stanford University Lines: 34 > > I just started writing my first (almost) Macintosh application on > my Lisa in Lisa Pascal. I've gone to Mac Highschool and learned > how a Macintosh program is almost always structured. > (Initialization and then a loop which does a GetNextEvent, > processes the even, and then, perhaps, does a little background > work on the side.) I began to port a simple graphics program from > Macintosh Pascal and discovered that it didn't fit very well into > the above mold. The problem is that my program may take a very > long time to complete. I don't want to freeze up my Mac until it's > done (which with certain parameters, could be days), so I will need > to every so often exit from my calculations and do another lap > around my GetNextEvent loop. Okay. That sounds doable at first > until I think of the structure of my calculations: Procedures > calling procedures calling procedures doing graphics. I will be > spending perhaps minutes in the inner most procedure. I can tell > when I need to leave an check the event list but I will then have > to save the state of all of my procedures (with Pascal code), > leave, check the event queue, return, discover (by some flag) that > I'm not just starting but am continuing, climb through some very > hacky looking code, reinitializing all three procedures to the > state where I left off, and continue for a while. Yuch!!!!! AH! A fellow Lisa Pascal user. Welcome. It seems like you could use a multi-tasking package (with pipe capability) which was offered as part of the software supplement. I don't think that it is in the latest release but it is certainly available in earlier releases. (You DO keep the old disks don't you?) The routines are on one of the Lisa workshop disks and all have prefix serial/ or pipes/. There is no printed documentation and I cannout vouch for their stability, but they might just do the job for you. Gus Fernandez