comp.lang.ada
 help / color / mirror / Atom feed
* Requeue in GNAT 3.14p (Linux)
@ 2002-06-19 13:17 Dmitry A. Kazakov
  2002-06-19 14:22 ` Pascal Obry
  2002-06-19 14:45 ` Anatoly Chernyshev
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitry A. Kazakov @ 2002-06-19 13:17 UTC (permalink / raw)


Hi!

The following code is the distilled problem. When a chain of external
requeues returns back to a protected object it causes a hang-up on the
last requeue. It happens in GNAT 3.14p under Linux. Interestingly is
that under Windows NT it works. I found nothing in ARM that forbids
that. Is it a GNAT bug?

------------------------------ test.adb
with Ping_Pong; use Ping_Pong;

procedure Test is
begin
   A.Service;
end Test;
------------------------------ ping_pong.ads
package Ping_Pong is
   protected A is
      entry Service;
      entry Back;
   end A;
   
   protected B is
      entry Wall;
   end B;
   
end Ping_Pong;
---------------------------- ping_pong.adb
with Text_IO;

package body Ping_Pong is
   protected body A is
      entry Service when True is
      begin
         Text_IO.Put_Line ("Service!");
         requeue B.Wall;
      end Service;
      entry Back when True is
      begin
         Text_IO.Put_Line ("Got it!");
      end Back;
   end A;
   
   protected body B is
      entry Wall when True is
      begin
         Text_IO.Put_Line ("Wall!");
         requeue A.Back;
      end Wall;
   end B;

end Ping_Pong;

---
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Requeue in GNAT 3.14p (Linux)
  2002-06-19 13:17 Requeue in GNAT 3.14p (Linux) Dmitry A. Kazakov
@ 2002-06-19 14:22 ` Pascal Obry
  2002-06-19 19:20   ` Robert A Duff
  2002-06-20  7:11   ` Dmitry A.Kazakov
  2002-06-19 14:45 ` Anatoly Chernyshev
  1 sibling, 2 replies; 5+ messages in thread
From: Pascal Obry @ 2002-06-19 14:22 UTC (permalink / raw)



Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> writes:

> Hi!
> 
> The following code is the distilled problem. When a chain of external
> requeues returns back to a protected object it causes a hang-up on the
> last requeue. It happens in GNAT 3.14p under Linux. Interestingly is
> that under Windows NT it works. I found nothing in ARM that forbids
> that. Is it a GNAT bug?

You can't have IO in a protected object. Does it hang if you remove the IO ?

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Requeue in GNAT 3.14p (Linux)
  2002-06-19 13:17 Requeue in GNAT 3.14p (Linux) Dmitry A. Kazakov
  2002-06-19 14:22 ` Pascal Obry
@ 2002-06-19 14:45 ` Anatoly Chernyshev
  1 sibling, 0 replies; 5+ messages in thread
From: Anatoly Chernyshev @ 2002-06-19 14:45 UTC (permalink / raw)



"Dmitry A. Kazakov" wrote:

> The following code is the distilled problem. When a chain of external
> requeues returns back to a protected object it causes a hang-up on the
> last requeue. It happens in GNAT 3.14p under Linux. Interestingly is
> that under Windows NT it works. I found nothing in ARM that forbids
> that. Is it a GNAT bug?

Yes, it works under W2000 without errors. Thanks for the simplest requeue
sample I was looking for.

Anatoly




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Requeue in GNAT 3.14p (Linux)
  2002-06-19 14:22 ` Pascal Obry
@ 2002-06-19 19:20   ` Robert A Duff
  2002-06-20  7:11   ` Dmitry A.Kazakov
  1 sibling, 0 replies; 5+ messages in thread
From: Robert A Duff @ 2002-06-19 19:20 UTC (permalink / raw)


Pascal Obry <p.obry@wanadoo.fr> writes:

> You can't have IO in a protected object. Does it hang if you remove the IO ?

But doesn't GNAT claim to support IO in protected objects
(even though the RM says it's a bounded error)?

I don't see anything wrong with that pattern of requeues,
other than the IO.  Unless I'm missing something...

- Bob



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Requeue in GNAT 3.14p (Linux)
  2002-06-19 14:22 ` Pascal Obry
  2002-06-19 19:20   ` Robert A Duff
@ 2002-06-20  7:11   ` Dmitry A.Kazakov
  1 sibling, 0 replies; 5+ messages in thread
From: Dmitry A.Kazakov @ 2002-06-20  7:11 UTC (permalink / raw)


Pascal Obry wrote:

> Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> writes:
> 
>> The following code is the distilled problem. When a chain of external
>> requeues returns back to a protected object it causes a hang-up on the
>> last requeue. It happens in GNAT 3.14p under Linux. Interestingly is
>> that under Windows NT it works. I found nothing in ARM that forbids
>> that. Is it a GNAT bug?
> 
> You can't have IO in a protected object.

Sure, but it works in GNAT, which is nice when debugging is needed.

>Does it hang if you remove the IO?

Yep.

BTW, Windows version allows some things that are bouded errors according to 
ARM. For instance, [if I correctly remember] one can do an external call to 
a procedure of same protected object and it will not hang. But Linux 
version will hang. But this is of course OK according to ARM. Though it is 
a nastsy kind of error which is very hard to track down.

-- 
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-06-20  7:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-19 13:17 Requeue in GNAT 3.14p (Linux) Dmitry A. Kazakov
2002-06-19 14:22 ` Pascal Obry
2002-06-19 19:20   ` Robert A Duff
2002-06-20  7:11   ` Dmitry A.Kazakov
2002-06-19 14:45 ` Anatoly Chernyshev

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