From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cbb4573e858c2040 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Newbie: Clarification of non-determinsitcis selection in Ada rendevous Mechanism Date: 2000/05/17 Message-ID: #1/1 X-Deja-AN: 624529757 Sender: bobduff@world.std.com (Robert A Duff) References: <8fstnl$dd$1@news.ihug.co.nz> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-05-17T00:00:00+00:00 List-Id: "nootah" writes: > Question is: if the selection of action from a select clause is > non-deterministic, then does the active object pause at the select statement > or does it elect one of the processes to wait for - the altter is what I > have been told. No, that's wrong. The task waits at the select statement. Whatever calling task comes in first gets accepted (assuming there are no guards, or all guards are true). The called task does not choose which one to wait for when it doesn't know which one is going to happen! 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. >... My problem with this - if multiple guard conditions are > simultaneously true, and one is selected prior to any call, then what occurs > when one of the client processes calls another guarded func. Good point -- that rule wouldn't work very well. Luckily, that's not the rule. ;-) > e.g. where a=5 > > select > when a>0 => > accept(FirstFunc) > when a<10 => > accept(SecondFunc) > end select > end select > > If object halts at select and waits for request from client > what happens if func called and guard condition not fulfilled ? - > presumably client blocks until condition met and task can respond - queues > the request and blocks client Right. (That's not the above example -- in the above example, both guards are True.) > On the other hand, if object elects FirstFunc, but client SecondFunc is > first call received - what happens ? presumably .. I have no idea! The task does not elect FirstFunc unless and until there's a caller for FirstFunc. - Bob