comp.lang.ada
 help / color / mirror / Atom feed
From: belteshazzar <gbelteshazzar@gmail.com>
Subject: Re: requeue with abort and timed call
Date: Sun, 4 Jan 2009 15:17:39 -0800 (PST)
Date: 2009-01-04T15:17:39-08:00	[thread overview]
Message-ID: <86e1e26c-108e-4f8e-9dc8-0eeaadce84d3@r15g2000prh.googlegroups.com> (raw)
In-Reply-To: gwc1w1s43e4.1v29vob1eu1o0$.dlg@40tude.net

On Jan 4, 1:56 pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> On Sun, 4 Jan 2009 10:03:44 -0800 (PST), ishik...@arielworks.com wrote:
> > On Jan 4, 6:09 am, "Jeffrey R. Carter"
> > <spam.jrcarter....@spam.acm.org> wrote:
> >> Delay statements and calls to Ada.Text_IO.Put_Line are potentially blocking
> >> operations. It is an error to call potentially blocking operations from a
> >> protected action. See ARM 9.5.1.
> > I'm sorry, I overlooked it.
>
> No, it is perfectly legal to use Put_Line in protected actions *with* GNAT.
>
> GNAT implementation explicitly permits this use. So Jeffrey's comment was
> irrelevant here.
>
> You should report this bug to AdaCore.
>
> > How about this one;
>
> > with Ada.Text_IO; use Ada.Text_IO;
> > procedure Timed_Protected is
> >    Z : boolean := True;
>
> Pedantically, you should have added pragma Atomic (Z), because you access
> it from different tasks. And probably Volatile (Z) to prevent loop
> optimization.
>
> But much simpler would be a primitive busy waiting:
>
> entry E1 when True is
>    T : Time := Clock + 5.0;
> begin
>    for I in Unsigned_64'Range loop
>       exit when Clock >= T;
>    end loop;
> end E1;
>
> --
> Regards,
> Dmitry A. Kazakovhttp://www.dmitry-kazakov.de

it was my understanding that pragma atomic does nothing for tasks, it
just tells the compiler to ensure that the architecture implements
atomic memory access.

also if pragma atomic is used this implies volatile.



  reply	other threads:[~2009-01-04 23:17 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
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 [this message]
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