Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site dartvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!decvax!dartvax!mss From: mss@dartvax.UUCP (Mark Sherman) Newsgroups: net.micro.mac Subject: Coroutines (and tasks) for the Macintosh Message-ID: <3685@dartvax.UUCP> Date: Thu, 10-Oct-85 17:16:01 EDT Article-I.D.: dartvax.3685 Posted: Thu Oct 10 17:16:01 1985 Date-Received: Sun, 13-Oct-85 04:10:10 EDT Reply-To: mss@dartvax.UUCP (Mark Sherman) Organization: Dartmouth College, Hanover, NH Lines: 19 People who are desparate for coroutines can have a copy of a Lisa Pascal Unit that I wrote which provides tasking and coroutines for Macintosh programs cross developed on the Lisa. Beware of two kludges. The first is that the task scheduler is nonpreemptive -- I based the design on the "light-weight tasking package" which exists in many flavors for various Xerox and IBM PC-like machines. You must call "yield" when a task is willing to relinquish control, sort of like "SystemTask" which everyone knows and loves. Second, as a compatibility measure with Pascal types, all coroutines and tasks must have a signature compatible with: FUNCTION MyTask(Input:PTR): PTR; The idea is that you can pass a pointer to whatever block of information you want. In fact, any 4-byte sized thing will do. You might pass/return a Longint, or pass a variable by refernece, and all the "right" things will happen. Unfortunately, I am still writing documentation and demo programs to illustrate the package -- all I have for now is my test pogram which tries out various calls in various ways. If there is sufficient interest, I'll post the Unit sources to the net.