From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.50.115.40 with SMTP id jl8mr43079620igb.3.1416519386338; Thu, 20 Nov 2014 13:36:26 -0800 (PST) X-Received: by 10.50.61.135 with SMTP id p7mr238959igr.9.1416519386158; Thu, 20 Nov 2014 13:36:26 -0800 (PST) Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!h15no4590535igd.0!news-out.google.com!ks2ni26178igb.0!nntp.google.com!uq10no2084764igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 20 Nov 2014 13:36:25 -0800 (PST) In-Reply-To: <546e5862$0$1628$426a34cc@news.free.fr> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: <546e5862$0$1628$426a34cc@news.free.fr> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Select then abort can fail to abort the abortable part From: Adam Beneschan Injection-Date: Thu, 20 Nov 2014 21:36:26 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.giganews.com comp.lang.ada:190888 Date: 2014-11-20T13:36:25-08:00 List-Id: On Thursday, November 20, 2014 1:08:51 PM UTC-8, Jean Fran=E7ois Martinez w= rote: > Is this incorrect behavior? I believe it's incorrect behavior only if a compiler supports Annex D (beca= use then section D.6 about Preemptive Abort must apply). If a compiler doe= sn't support Annex D, then an abortable part must be aborted only at certai= n "abort completion points" as defined by 9.8(16-19); if the code keeps run= ning without reaching any of those points, it doesn't have to abort. =20 My understanding is that Windows native compilers can't really support Anne= x 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 e= xperience 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 happ= ens while one signal is being handled so that there's a danger that the sig= nal 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. See this earlier thread: https://groups.google.com/forum/?hl=3Den#!searchin= /comp.lang.ada/D.6$20AND$20after$3A2013$2F01$2F01$20AND$20before$3Atoday%7C= sort:relevance/comp.lang.ada/748DRqqa7v0/llYfPx731ucJ -- Adam