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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,e8e240cec570cdf2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-19 08:05:02 PST Path: supernews.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!195.25.12.36!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: Multiple entry tasks Date: Thu, 19 Apr 2001 17:02:31 +0200 Organization: Adalog Message-ID: <9bmuo9$50h$1@s1.read.news.oleane.net> References: <9bkevj$61k$1@nh.pace.co.uk> <9bm76r$mf6$1@s1.read.news.oleane.net> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 987692618 5137 195.25.228.57 (19 Apr 2001 15:03:38 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 19 Apr 2001 15:03:38 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Xref: supernews.google.com comp.lang.ada:7005 Date: 2001-04-19T17:02:31+02:00 List-Id: "Ted Dennison" a �crit dans le message news: pPCD6.2928$D4.287059@www.newsranger.com... > In article <9bm76r$mf6$1@s1.read.news.oleane.net>, Jean-Pierre Rosen says... > > > > > >"Marin David Condic" a �crit dans > >le message news: 9bkevj$61k$1@nh.pace.co.uk... > >> select > >> when (Entry2'Count <= 0) and (Entry1'Count <= 0) => > >> accept Entry3 ; > >> when (Entry1'Count <= 0) => > >> accept Entry2 ; > >> or > >> accept Entry1; > >> else > >> terminate; > >> end select ; > >> > >This is wrong. Guards are evaluated only when the select is entered (unlike > >POs), therefore if a task cancels its call (through timed entry call) while > >the guards are being evaluated, you may end up in a situation of infinite > >blocking. > > :-) > > I made the same misreading as you on my first post. The guards will only close > if there is already an entry available on another branch. In that case the > higher priority entry will be immediately accepted, so there will be no blocking > at all. Thus there cannot be infinte blocking (execpt where intended :-) ). I did the same misreading as you, but realized it before I posted. Now, you misread my response ;-) The sequence of events I was thinking of is the following: Imagine that at the time you reach the select, there are calls for Entry2 and Entry3. 1) Evaluate the guard for Entry3. Since there is a call to Entry2, the guard is closed 2) The call to Entry2 times out (it was a timed entry call). 3) Finish evaluating guards and block on select. You start waiting for Entry2 and Entry1, although there is a call to Entry3 pending If the logic of the caller is such that the next call to Entry1 or Entry2 will be issued only after Entry3 is serviced, you have dead-lock. > I think the confusing part was that he used "<= 0" rather than "= 0". Agreed. I was confused by that too. And no, a 'Count cannot be negative. I always find this kind of "extra security" damaging. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr