comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean François Martinez" <darkquark99@gmail.com>
Subject: Re: Select then abort can fail to abort the abortable part
Date: 20 Nov 2014 22:55:38 GMT
Date: 2014-11-20T23:55:38+01:00	[thread overview]
Message-ID: <546e716a$0$2382$426a34cc@news.free.fr> (raw)
In-Reply-To: e9dfeead-b7a8-48d0-831e-30dad054145e@googlegroups.com

On Thu, 20 Nov 2014 13:36:25 -0800, Adam Beneschan wrote:

> On Thursday, November 20, 2014 1:08:51 PM UTC-8, Jean François Martinez
> wrote:
> 
>> Is this incorrect behavior?
> 
> I believe it's incorrect behavior only if a compiler supports Annex D
> (because then section D.6 about Preemptive Abort must apply).  If a
> compiler doesn't support Annex D, then an abortable part must be aborted
> only at certain "abort completion points" as defined by 9.8(16-19); if
> the code keeps running without reaching any of those points, it doesn't
> have to abort.
> 

Actually Gnat is supposed to support Annex D but in Linux there are 
several units of it marked as non implementable on Linux.

I have looked in the ARM both for delay and select then abort and there 
is nothing or at least I have seen nothing.

> My understanding is that Windows native compilers can't really support
> Annex D because the OS makes it difficult to abort a thread in the
> needed way.  On Unix/Linux, a timer could be set up that causes a
> signal; however, my experience with Unix/Linux signals is that it's easy
> to get yourself hosed, if a signal happens to occur at an inopportune
> time, or another signal happens while one signal is being handled so
> that there's a danger that the signal might get lost.  So while I have
> no idea whether GNAT for Linux claims to support Annex D, it would be
> understandable to me that it wouldn't.
> 
> A workaround is to put "delay 0.0" at strategic points in your code,
> since that's an abort completion point.  It would essentially poll to
> see if the delay in the SELECT has expired.  GNAT also has a Polling
> pragma, at least for Windows, but maybe it works on Linux too.
> 

Actually I was thinking about using timing events: inserting delays in 
the code is difficult: simple solutions like checking every N prime 
numbers found do not work since finding an new one is far longer at 100 
million than at ten thousand.  Checking every N tests is ugly and heavy.

---
Jean-François Martinez


      reply	other threads:[~2014-11-20 22:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-20 21:08 Select then abort can fail to abort the abortable part Jean François Martinez
2014-11-20 21:35 ` Dmitry A. Kazakov
2014-11-20 22:19   ` Jean François Martinez
2014-11-21  8:37     ` Dmitry A. Kazakov
2014-11-21 15:26       ` Jean François Martinez
2014-11-20 21:36 ` Adam Beneschan
2014-11-20 22:55   ` Jean François Martinez [this message]
replies disabled

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