comp.lang.ada
 help / color / mirror / Atom feed
From: ishikawa@arielworks.com
Subject: Re: requeue with abort and timed call
Date: Sun, 28 Dec 2008 09:46:31 -0800 (PST)
Date: 2008-12-28T09:46:31-08:00	[thread overview]
Message-ID: <4c7abc6f-d6d3-4265-8311-1bbb40cc0c0a@z27g2000prd.googlegroups.com> (raw)
In-Reply-To: b990c191-972f-4729-82d7-41947cc87365@n33g2000pri.googlegroups.com

Thank you for your replyes.

>But in your code, the call has
>been selected, just not completed (English usage, not RM language).

>Concurrently the main task proceeds to the select statement, where it
>waits at most 1 s for the rendezvous to take place. Since T is already
>waiting there, the rendezvous takes place, so the "or delay" is never
>executed. The rendezvous terminates after 3 s, and T goes into the
>infinte loop.

As you said, it is a correct that Original_Call is not aborted.
But I think that Requeued_Call must be aborted when the original
expiration time is already over and the "requeued" entry call is on
the queue.
Of course, if the "requeue" is not followed by "with abort",
Requeued_Call will be not aborted.

Time line is like following;
 0.0 The call of Original_Call
*1.0 The expiration time of original call(select or delay)
 3.0 Complete Original_Call
*3.0 Queued on Requeued_Call

>With 9.7.2(5) in mind, I think the delay in the select statement must
>be longer than it takes T to arrive at the requeue.nIn your case, the
>delay expires before T reaches the requeue. If you increase the delay
>to 4 s

If the delay changed to 4;
 0.0 The call of Original_Call
 3.0 Complete Original_Call
*3.0 Queued on Requeued_Call
*4.0 The expiration time of original call(select or delay)
 N/A Reueued_Call will be never called

In this case, the Requeued_Call will be aborted.

But, please think about following code.
Sometimes we cannot decide how long time procedures take.
For example, if "Procedure_Tkaes_0sec_to_60sec" takes for 0.3 or to
0.0999..., Requeued_Call will be aborted.
but, if it takes over 1 sec, Requeued_Class will be not aborted
forever.
This behavior is repugnant, I think.
---
      accept Original_Call do
         Put_Line ("Original Call...");
         -- We have no idea about how long time following procedure
takes.
         -- e.g.) 0 sec. in the best case, 60 sec. in the worth case.
         Procedure_Takes_0sec_to_60sec
         Put_Line ("Original Call Done");
         requeue Requeued_Call with abort;
      end Original_Call;
---

(In addition, we can give even negative duration to delay statements
in some cases.
"delay until" statements is available for fixed expiration time.)



  reply	other threads:[~2008-12-28 17:46 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 [this message]
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
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