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: How do I force a context switch? Message-ID: <5175@utcsri.UUCP> Date: Fri, 31-Jul-87 16:58:37 EDT Article-I.D.: utcsri.5175 Posted: Fri Jul 31 16:58:37 1987 Date-Received: Sat, 1-Aug-87 16:23:05 EDT Reply-To: flaps@utcsri.UUCP (Alan J Rosenthal) Distribution: world Organization: University of Toronto Lines: 25 How does a task tell the exec that it wants to give up the rest of its current cpu-time quantum? I am currently using Delay(1L), which will probably work fine but is exceedingly ugly. In case you want to know, this is why I need to force a context switch. 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 before proceeding. Since this is the second line in the code of the first function, all it has to do is give up the rest of its cpu quantum this time around which will give the other task a chance to run before this one runs any more, thus setting the variable. -- // 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."