Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!amdcad!sun!pepper!cmcmanis From: cmcmanis@pepper.UUCP Newsgroups: comp.sys.amiga Subject: Re: How do I force a context switch? Message-ID: <24762@sun.uucp> Date: Mon, 3-Aug-87 16:38:07 EDT Article-I.D.: sun.24762 Posted: Mon Aug 3 16:38:07 1987 Date-Received: Wed, 5-Aug-87 03:29:46 EDT References: <5175@utcsri.UUCP> Sender: news@sun.uucp Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Distribution: world Organization: Sun Microsystems, Mountain View Lines: 22 In article <5175@utcsri.UUCP> flaps@utcsri.UUCP (Alan J Rosenthal) writes: .> .>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. One way to do this would be to have the slave tasks all wait on one of the 'break' signals. (^C ^D ^E ^F). When the main task has set the global it could signal all of the other tasks that the global was ready to be used. A more robust way would be to have the task that sets the global start the other tasks after it has set it. Then no sleeping would be required. A third way is to use a named message port to pass around the data. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.