Requeue in GNAT 3.14p (Linux) 
Author Message
 Requeue in GNAT 3.14p (Linux)

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



Sun, 05 Dec 2004 21:17:45 GMT  
 Requeue in GNAT 3.14p (Linux)


Quote:
> 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



Sun, 05 Dec 2004 22:22:38 GMT  
 Requeue in GNAT 3.14p (Linux)

Quote:

> 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



Sun, 05 Dec 2004 22:45:42 GMT  
 Requeue in GNAT 3.14p (Linux)

Quote:


>> 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.

Quote:
>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



Mon, 06 Dec 2004 15:11:54 GMT  
 Requeue in GNAT 3.14p (Linux)

Quote:

> 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



Mon, 06 Dec 2004 03:20:47 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Looking for GNAT 3.14p for Alpha/Linux

2. Problem with gnat-3.14p on Linux

3. tasking with GNAT 3.14p on windows

4. ANN: gnat-3.14p rpms available for Red Hat 7

5. Announce: HPUX-11 Binaries for GNAT-3.14p/3.15p Available (and HOWTO)

6. Pragma Import don't suppress intialization on access type with GNAT 3.14p

7. Overriding discriminants perplexes GNAT 3.14p

8. Streams in GNAT 3.14p

9. GNAT 3.14p and Red Hat 7.2

10. RPM package for GNAT 3.14p ?

11. patch to Gnat 3.14p NT posted

12. ACT announces availability of GNAT 3.14p

 

 
Powered by phpBB® Forum Software