comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: requeue with abort and timed call
Date: Tue, 30 Dec 2008 17:52:13 -0500
Date: 2008-12-30T17:52:13-05:00	[thread overview]
Message-ID: <wccvdt11dk2.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: a2cbdab7-d410-4bc3-b06b-43370454855b@r15g2000prh.googlegroups.com

sjw <simon.j.wright@mac.com> writes:

> On Dec 30, 9:25�am, Jean-Pierre Rosen <ro...@adalog.fr> wrote:
>> 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.
>
> My problem is rather more with the idea of doing work in the accept of
> size comparable with the caller's permissible waiting period *and
> then* requeueing.

I don't understand your "problem".  The server doesn't know how long
clients might want to wait.  In fact, the client might say "delay 0.0"
(or "else", which is equivalent).

The server needs to decide whether it's OK to have the whole operation
canceled in the middle -- i.e. decide whether the requeue should be with
or without "abort".

> OK, I was confused about abort-deferral. Not the first time. But if it
> is to be "transparent from the client's side", then it would be
> reasonable for it to make no difference to the behaviour as seen by
> the caller whether or not there is a requeue in the internals of the
> callee. It's legitimate (well, no one has said it's wrong) for the
> caller to be delayed well past its timed entry limit if there is a lot
> of processing in the accept and no requeue.

Yes, that can happen.  So don't put too much code in the accept (or in
the requeued accept, if without "abort").

> What about
>   1 timed entry starts
>   2 original entry accepted
>   3 requeued
>   4 requeued entry started
>   5 timed entry expires but has no effect
>   6 requeued work continues for a significant period
>
> From the outside, you would be hard put to distinguish this from the
> case where 4 & 5 were reversed, I think.

Seems to me that's in the nature of timing.  I mean, if you have
timeouts in your code, there's always a potential for race conditions --
no matter what you are timing out, the timeout could occur just a little
bit earlier or a little bit later.  And it's impossible for the language
definition to define precisely how long things take.

- Bob



  reply	other threads:[~2008-12-30 22:52 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
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 [this message]
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