comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen@adalog.fr>
Subject: Re: Multiple entry tasks
Date: Thu, 19 Apr 2001 17:02:31 +0200
Date: 2001-04-19T17:02:31+02:00	[thread overview]
Message-ID: <9bmuo9$50h$1@s1.read.news.oleane.net> (raw)
In-Reply-To: pPCD6.2928$D4.287059@www.newsranger.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]

"Ted Dennison" <dennison@telepath.com> 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" <marin.condic.auntie.spam@pacemicro.com> 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





  parent reply	other threads:[~2001-04-19 15:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-18 14:57 Multiple entry tasks Lutz Donnerhacke
2001-04-18 16:22 ` Marin David Condic
2001-04-18 18:12   ` Ted Dennison
2001-04-18 18:57     ` Ted Dennison
2001-04-18 20:16       ` Marin David Condic
2001-04-19 14:02         ` Ted Dennison
2001-04-19 14:28           ` Marin David Condic
2001-04-18 19:46     ` Marin David Condic
2001-04-19 21:52       ` Robert A Duff
2001-04-24  9:19         ` Lutz Donnerhacke
2001-04-19  8:17   ` Jean-Pierre Rosen
2001-04-19 14:42     ` Ted Dennison
2001-04-19 15:01       ` Marin David Condic
2001-04-19 15:02       ` Jean-Pierre Rosen [this message]
2001-04-19 19:12         ` Ted Dennison
2001-04-20 14:17           ` Jean-Pierre Rosen
2001-04-20 19:04             ` Ted Dennison
2001-04-23  6:55               ` Jean-Pierre Rosen
2001-04-23 13:50                 ` Ted Dennison
replies disabled

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