Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!utcsri!flaps From: flaps@utcsri.UUCP Newsgroups: comp.sys.amiga Subject: Re: How do I force a context switch? Message-ID: <5188@utcsri.UUCP> Date: Tue, 4-Aug-87 16:38:55 EDT Article-I.D.: utcsri.5188 Posted: Tue Aug 4 16:38:55 1987 Date-Received: Wed, 5-Aug-87 06:42:28 EDT References: <5175@utcsri.UUCP> Reply-To: flaps@utcsri.UUCP (Alan J Rosenthal) Distribution: world Organization: University of Toronto Lines: 33 Summary: In a recent article, I, flaps@utcsri.UUCP (Alan J Rosenthal), write: >How does a task tell the exec that it wants to give up the rest of its >current cpu-time quantum? > >... I'm writing a program where several tasks are started. >Through use of priorities, all are started at once. One of these >functions sets a global variable that others need. If through bad luck >another function starts running first and tries to use this global >variable before it's set, it has to allow the first function to set it... Many people have explained alternate ways of expressing the algorithm listed above. But this is not the whole story, and none of these solve my problem. We are writing library routines. The programmer using our routines can call a routine to create a task. They can start our special task to handle some things, and their own task to use these facilities. We want our special task to be programmed just like a user task. This wouldn't be necessary; we could special-case it in the create-a-task function, but we SHOULDN'T HAVE TO!! Most multitasking systems provide a way to force a context switch. It is extremely easy to implement. I'm sure that there are kludgey ways to do it on the Amiga, but I would like to do it nicely. -- // Alan J Rosenthal // \\ // flaps@csri.toronto.edu, {seismo!utai or utzoo}!utcsri!flaps, \// flaps@toronto on csnet, flaps at utorgpu on bitnet. "To be whole is to be part; true voyage is return."