comp.lang.ada
 help / color / mirror / Atom feed
From: Jean-Pierre Rosen <rosen@adalog.fr>
Subject: Re: requeue with abort and timed call
Date: Tue, 30 Dec 2008 10:25:34 +0100
Date: 2008-12-30T10:25:34+01:00	[thread overview]
Message-ID: <kepcjg.od.ln@hunter.axlog.fr> (raw)
In-Reply-To: <2a0a1de3-6736-4478-9378-50b8895fa20d@r15g2000prh.googlegroups.com>

sjw a �crit :
> The whole example is far from clear to me. If I were reviewing this
> design I would have great difficulty understanding what the designer
> was trying to do and whether the code achieved it.
Sure, this is only an example to show an issue and demonstrate a problem.
In real life, you wouldn't have seconds, but micro-seconds. Would be 
much more difficult to experiment with.

> The decision to requeue ought to be speedy. Requeue because you can't
> deal with it now; don't ponder for 3 seconds and then decide to
> requeue for a further arbitrary period.
Once again, the problem is not with the 3s. Could be much shorter.
> 
> If the code said
> 
>          accept Original_Call do
>             Put_Line ("Original Call...");
>             delay 3.0;
>             Put_Line ("Original Call Done");
>          end Original_Call;
> 
> ie without the requeue, the timed entry call would not be cancelled,
> because we're abort-deferred. 
You are confusing things here, this has nothing to do with 
abort-deferral. Abort-deferral means that the called task cannot be 
aborted while engaged in a rendezvous. Timed entry call is about the 
caller being removed from the queue if the delay expires before the 
rendezvous has started.

> So a caller design which relies on the
> callee having/not having a requeue is broken.
No. A timed entry call means: "if the server does not arrive within XX 
seconds, I give up". Requeue (with abort) allows the server to get the 
request, inspect the parameters, and decide that this request cannot be 
serviced now and put it back on wait. This is transparent as seen from 
the client's side.

> Isn't it normally considered bad practice to do extensive processing
> within the accept statement?
Not within accept statements, but within protected subprograms or 
entries. Accept statements are of a much higher level of abstraction 
than POs.

-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



  reply	other threads:[~2008-12-30  9:25 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-28 13:24 requeue with abort and timed call ishikawa
2008-12-28 14:30 ` Dmitry A. Kazakov
2008-12-28 15:53   ` christoph.grein
2008-12-28 16:09     ` christoph.grein
2008-12-28 17:46       ` ishikawa
2008-12-29 10:23         ` christoph.grein
2008-12-29 10:55           ` Dmitry A. Kazakov
2008-12-29 11:17             ` christoph.grein
2008-12-29 12:27               ` Dmitry A. Kazakov
2008-12-28 17:16     ` Dmitry A. Kazakov
2008-12-28 21:42       ` Robert A Duff
2008-12-29 10:42       ` Jean-Pierre Rosen
2008-12-29 21:05         ` sjw
2008-12-30  9:25           ` Jean-Pierre Rosen [this message]
2008-12-30 13:18             ` christoph.grein
2008-12-30 15:39               ` Jean-Pierre Rosen
2008-12-30 17:01                 ` christoph.grein
2008-12-30 17:16                   ` ishikawa
2008-12-30 15:54               ` ishikawa
2008-12-30 21:33             ` sjw
2008-12-30 22:52               ` Robert A Duff
2008-12-31  9:21               ` Jean-Pierre Rosen
2008-12-31 15:39                 ` christoph.grein
2008-12-31 16:14                   ` Jean-Pierre Rosen
2009-01-03 16:49                     ` ishikawa
2009-01-03 21:09                       ` Jeffrey R. Carter
2009-01-04 15:40                         ` christoph.grein
2009-01-04 17:09                           ` Jeffrey R. Carter
2009-01-04 18:03                         ` ishikawa
2009-01-04 18:56                           ` Dmitry A. Kazakov
2009-01-04 23:17                             ` belteshazzar
2009-01-05  9:12                               ` Dmitry A. Kazakov
2009-01-05  2:48                             ` Jeffrey R. Carter
2009-01-05  9:30                               ` Dmitry A. Kazakov
2009-01-05 20:28                                 ` Jeffrey R. Carter
2009-01-05 20:47                                   ` Dmitry A. Kazakov
2009-01-06  2:35                                     ` Jeffrey R. Carter
2009-01-05 10:17                           ` Jean-Pierre Rosen
2008-12-28 15:53 ` sjw
replies disabled

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