comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: Newbie: Clarification of non-determinsitcis selection in Ada rendevous Mechanism
Date: 2000/05/17
Date: 2000-05-17T00:00:00+00:00	[thread overview]
Message-ID: <8fuemq$bv7$1@nnrp1.deja.com> (raw)
In-Reply-To: wccg0rh1eyn.fsf@world.std.com

In article <wccg0rh1eyn.fsf@world.std.com>,
  Robert A Duff <bobduff@world.std.com> wrote:
> The nondeterminism mainly comes into play when there are two or more
> tasks already waiting in entry queues when the select statement is
> reached.  In that case, a caller is selected nondeterministically,
> according to the core RM semantics.  In the Real Time Annex, however,
> the selection criteria are nailed down more tightly.

To be more specific, on two *different* entry queues. If multiple tasks
are waiting on the *same* entry, they are accepted FIFO. If FIFO isn't
flexible enough for you, you can implement other schemes using the
requeue statement.


I'll attempt to clarify. When a task or guarded object gets to a select
statement it first evaluates the guards on the alternatives. If some are
true, then there are two possible situations; either there are tasks
already waiting on one or more entries, or there aren't any waiting. If
there aren't any tasks waiting on any entry, it will wait for a task to
request (any) one of them. It will accept the first one that comes in.

If there are already tasks waiting for only one entry, it will
immediately process the first task waiting on that entry. If there are
already tasks waiting for *more* than one open entry, *then* it will
non-determinsticly choose which entry to accept.

Note that the guards are only evaluated right before the waiting starts.
If one changes while the task/object is waiting, that does not change
the entries that it waits on.

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com http://www.deja.com/
Before you buy.




      reply	other threads:[~2000-05-17  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-17  0:00 Newbie: Clarification of non-determinsitcis selection in Ada rendevous Mechanism nootah
2000-05-17  0:00 ` Robert A Duff
2000-05-17  0:00   ` Ted Dennison [this message]
replies disabled

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