Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rochester!rutgers!ames!amdcad!sun!hoptoad!farren From: farren@hoptoad.uucp (Mike Farren) Newsgroups: comp.sys.amiga Subject: Re: How do I force a context switch? Message-ID: <2609@hoptoad.uucp> Date: Sun, 2-Aug-87 20:54:31 EDT Article-I.D.: hoptoad.2609 Posted: Sun Aug 2 20:54:31 1987 Date-Received: Mon, 3-Aug-87 03:46:23 EDT References: <5175@utcsri.UUCP> Reply-To: farren@hoptoad.UUCP (Mike Farren) Distribution: world Organization: Nebula Consultants in San Francisco Lines: 24 In article <5175@utcsri.UUCP> flaps@utcsri.UUCP (Alan J Rosenthal) writes: > > 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. Seems to me that relying on the scheduling algorithm in EXEC to synchronize your tasks is a dangerous and losing proposition. Why not have the main task Wait() until the first sub-task has set its global before launching the rest of the sub-tasks? Or, if it's truly a global, have the main task set it before launching the sub-tasks? I don't think that there's any guarantee that tasks will be run in the order launched, although that's the intuitive way of thinking about it. Unfortunately, intuition isn't always correct. -- ---------------- "... if the church put in half the time on covetousness Mike Farren that it does on lust, this would be a better world ..." hoptoad!farren Garrison Keillor, "Lake Wobegon Days"