comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Tasking and blocked threads
Date: 1999/09/10
Date: 1999-09-10T00:00:00+00:00	[thread overview]
Message-ID: <wccn1uun93l.fsf@world.std.com> (raw)
In-Reply-To: 37D849AE.AC5EA4F1@res.raytheon.com

Andy Askey <askeya@res.raytheon.com> writes:

> the STANDARD Ada95 model and the THREADED Ada95 model with Apex 3.0.0b
> on a Solaris 2.6 OS.  The output from the STANDARD model swaps between
> tasks alternating grouped lines of output.  A bunch of "in task one"
> lines are followed by a bunch of "YOMOMMA!!!!!" lines.  I was told that
> this was due to time slicing in the STANDARD model. 

Formally, the execution of this program is erroneous, and therefore
completely unpredictable, because two tasks are simultaneously writing
upon the same variable (the current output file).  So the compiler can
do whatever it likes.

Probably what's actually going on is that the I/O causes the tasks to
block.  That's allowed (and usually desirable).  Replace the I/O with
some in-memory manipulations of data structures, and see if the behavior
changes.

Of course, an implementation can provide whatever task dispatching
policies it likes; the run-till-blocked semantics is part of the Real
Time Annex.

- Bob
-- 
Change robert to bob to get my real email address.  Sorry.




  parent reply	other threads:[~1999-09-10  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-09  0:00 Tasking and blocked threads Andy Askey
1999-09-10  0:00 ` Ted Dennison
1999-09-10  0:00 ` Robert A Duff [this message]
1999-09-11  0:00 ` Martin Dowie
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox