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, MSGID_RANDY 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: Ted Dennison Subject: Re: Newbie: Clarification of non-determinsitcis selection in Ada rendevous Mechanism Date: 2000/05/17 Message-ID: <8fuemq$bv7$1@nnrp1.deja.com>#1/1 X-Deja-AN: 624567908 References: <8fstnl$dd$1@news.ihug.co.nz> X-Http-Proxy: 1.0 x38.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed May 17 15:43:27 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-05-17T00:00:00+00:00 List-Id: In article , Robert A Duff 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.