"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