* Aborting requeued entry calls
@ 2002-08-02 22:34 Dmitry A.Kazakov
2002-08-02 15:33 ` Robert A Duff
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry A.Kazakov @ 2002-08-02 22:34 UTC (permalink / raw)
Hi!
I have a problem and a question. Consider the following:
package Test_Abort is
protected Thing is
entry Foo_1;
entry Foo_2;
end Thing;
end Test_Abort;
------------------------
with Ada.Text_IO; use Ada.Text_IO;
package body Test_Abort is
protected body Thing is
entry Foo_1 when True is
begin
Put_Line ("Foo_1 requeues to Foo_2");
requeue Foo_2; -- w/o abort
end Foo_1;
entry Foo_2 when False is
begin
null;
end Foo_2;
end Thing;
end Test_Abort;
-------------------------
with Test_Abort; use Test_Abort;
with Ada.Text_IO; use Ada.Text_IO;
procedure Test is
begin
select
delay 1.0;
then abort
Thing.Foo_1;
end select;
Put_Line ("Why is that abortable?");
end Test;
--------------------------
The problem. From what I read about requeue with no abort I would expect
that Test should hang forever. Yet GNAT under Windows successfully
aborts Thing.Foo_1 (after it was requeued to Foo_2).
Is that OK?
If yes, then the question, if a requeued entry call may be silently removed
from the wait queue, how Thing could become aware of that? Let Foo_1
changes the state of Thing and Foo_2 restores it, then if Foo_2 get
silently aborted Thing becomes corrupted. Any solution?
Thanks.
--
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Aborting requeued entry calls
2002-08-02 22:34 Aborting requeued entry calls Dmitry A.Kazakov
@ 2002-08-02 15:33 ` Robert A Duff
2002-08-05 13:29 ` Dmitry A. Kazakov
0 siblings, 1 reply; 3+ messages in thread
From: Robert A Duff @ 2002-08-02 15:33 UTC (permalink / raw)
Dmitry A.Kazakov <mailbox@dmitry-kazakov.de> writes:
> Hi!
>
> I have a problem and a question. Consider the following:
>
> package Test_Abort is
> protected Thing is
> entry Foo_1;
> entry Foo_2;
> end Thing;
> end Test_Abort;
> ------------------------
> with Ada.Text_IO; use Ada.Text_IO;
>
> package body Test_Abort is
> protected body Thing is
> entry Foo_1 when True is
> begin
> Put_Line ("Foo_1 requeues to Foo_2");
> requeue Foo_2; -- w/o abort
> end Foo_1;
> entry Foo_2 when False is
> begin
> null;
> end Foo_2;
> end Thing;
> end Test_Abort;
> -------------------------
> with Test_Abort; use Test_Abort;
> with Ada.Text_IO; use Ada.Text_IO;
>
> procedure Test is
> begin
> select
> delay 1.0;
> then abort
> Thing.Foo_1;
> end select;
> Put_Line ("Why is that abortable?");
> end Test;
> --------------------------
>
> The problem. From what I read about requeue with no abort I would expect
> that Test should hang forever.
Yes, I think that's correct.
- Bob
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Aborting requeued entry calls
2002-08-02 15:33 ` Robert A Duff
@ 2002-08-05 13:29 ` Dmitry A. Kazakov
0 siblings, 0 replies; 3+ messages in thread
From: Dmitry A. Kazakov @ 2002-08-05 13:29 UTC (permalink / raw)
On Fri, 2 Aug 2002 15:33:17 GMT, Robert A Duff
<bobduff@shell01.TheWorld.com> wrote:
>Dmitry A.Kazakov <mailbox@dmitry-kazakov.de> writes:
>>
>> The problem. From what I read about requeue with no abort I would expect
>> that Test should hang forever.
>
>Yes, I think that's correct.
Thank you very much for the response!
[ It was so distressing when I discovered that three months of design
were probably wasted for nothing that I could not find a rest for two
days! ]
---
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-08-05 13:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-02 22:34 Aborting requeued entry calls Dmitry A.Kazakov
2002-08-02 15:33 ` Robert A Duff
2002-08-05 13:29 ` Dmitry A. Kazakov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox