comp.lang.ada
 help / color / mirror / Atom feed
From: Reto Buerki <reet@codelabs.ch>
Subject: Re: Barrier re-evaluation issue with GNAT 4.3.2
Date: Mon, 28 Sep 2009 15:25:18 +0200
Date: 2009-09-28T15:25:18+02:00	[thread overview]
Message-ID: <h9qdfj$6vp$1@news.eternal-september.org> (raw)
In-Reply-To: <nospam-E1A743.08392828092009@news.aioe.org>

John B. Matthews wrote:
> In article <h9q34o$odd$1@news.eternal-september.org>,
>  Reto Buerki <reet@codelabs.ch> wrote:
> 
>> John B. Matthews wrote:
>>> I get the same result with FSF GNAT 4.3.4. I revised your code to follow 
>>> the "protected Event" example seen here:
>>>
>>> <http://www.adaic.com/standards/95rat/RAThtml/rat95-p1-2.html#9>
>>>
>>> It seems to work. The compiler warns, "potentially blocking operation in 
>>> protected operation" in Wakeup, although the Signal barrier is always 
>>> true. I'm not sure the extra entries _should_ be required, but I think 
>>> it might be more reliable in the face of multiple threads calling Wait. 
>>> I don't know a reason why it wouldn't work under 4.3.2.
>> Thanks for your effort in confirming the issue with GNAT 4.3.4 and for
>> the "protected Event" example.
> 
> You're welcome.
> 
>> We will see how we can integrate your idea into our project as a
>> workaround for the re-evaluation problem.
> 
> This alternative approach also works, without using requeue:

Adapting your first example worked for us! We basically just moved the
Alarm_Fired assignment from Wakeup() into an extra Signal() entry:

procedure Wakeup (Event : in out Timing_Events.Timing_Event) is
begin
   Signal;
end Wakeup;

entry Signal when True is
begin
   Alarm_Fired := True;
end Signal;

This seems to cause a re-evaluation of the protected object barriers. It
does not work if Signal() is a protected procedure, it must be an entry.

> I am troubled by the "potentially blocking operation" warning. Two 
> things make me think it may be irrelevant: 1) Signal does not actually 
> block, except to dequeue waiters, and 2) Wakeup, which enters Signal, is 
> itself a protected procedure:
> 
> <http://www.adaic.com/standards/05rm/html/RM-D-15.html>
> 
> I'd welcome critical thoughts.

We are not getting such a warning with our code, but we are not using
"requeue" since our scenario is different.



  reply	other threads:[~2009-09-28 13:25 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-24 17:02 Barrier re-evaluation issue with GNAT 4.3.2 Reto Buerki
2009-09-24 17:47 ` Dmitry A. Kazakov
2009-09-25  8:50   ` Brad Moore
2009-09-25  9:17     ` Dmitry A. Kazakov
2009-09-25  9:57       ` Ludovic Brenta
2009-09-25 10:31         ` Dmitry A. Kazakov
2009-09-25 11:23       ` Jean-Pierre Rosen
2009-09-28 10:41         ` Reto Buerki
2009-09-25 17:06       ` Brad Moore
2009-09-25 18:42         ` Dmitry A. Kazakov
2009-09-25 19:39           ` Brad Moore
2009-09-28 10:18   ` Reto Buerki
2009-09-25 15:56 ` John B. Matthews
2009-09-26 14:23   ` John B. Matthews
2009-09-28 10:28   ` Reto Buerki
2009-09-28 12:39     ` John B. Matthews
2009-09-28 13:25       ` Reto Buerki [this message]
2009-09-28 14:05         ` Reto Buerki
2009-09-28 18:38           ` Jeffrey R. Carter
2009-09-28 18:51             ` Dmitry A. Kazakov
2009-09-29  8:37               ` Reto Buerki
2009-09-28 21:13             ` Robert A Duff
2009-09-28 22:28               ` Jeffrey R. Carter
2009-10-10  5:41                 ` Randy Brukardt
2009-09-29  8:30             ` Reto Buerki
2009-09-29 15:06               ` John B. Matthews
2009-09-30 14:12                 ` Reto Buerki
2009-09-30 15:59                   ` John B. Matthews
2009-10-01 16:12                     ` John B. Matthews
2009-10-01 17:17                       ` Anh Vo
2009-10-02  2:26                         ` John B. Matthews
replies disabled

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