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.66.144.7 with SMTP id si7mr17795660pab.32.1405628952283; Thu, 17 Jul 2014 13:29:12 -0700 (PDT) X-Received: by 10.50.79.230 with SMTP id m6mr554358igx.6.1405628952171; Thu, 17 Jul 2014 13:29:12 -0700 (PDT) Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.ripco.com!news.glorb.com!h18no1772414igc.0!news-out.google.com!bp9ni941igb.0!nntp.google.com!h18no3262189igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 17 Jul 2014 13:29:11 -0700 (PDT) In-Reply-To: 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: <50bdb713-7ce1-411b-810b-9bdee1d26b7a@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <39a6309b-2920-4cec-818a-eb8ee46474d9@googlegroups.com> Subject: Re: Timeouts in Ada From: Adam Beneschan Injection-Date: Thu, 17 Jul 2014 20:29:12 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.dca.giganews.com comp.lang.ada:187671 Date: 2014-07-17T13:29:11-07:00 List-Id: On Thursday, July 17, 2014 12:27:07 PM UTC-7, Jeffrey Carter wrote: > On 07/17/2014 12:38 AM, J-P. Rosen wrote: >=20 > > Not at all! In Ada, one task=3Done thread, there are no hidden threads. >=20 > Surely ATC involves a "hidden thread". After all, >=20 > select > > then abort > > end select; >=20 > is shorthand for >=20 > declare > task AP; > =20 > task body AP is > begin > > end AP; > begin > > abort AP; > end; Not quite. If the is an entry call, and the entry can be selecte= d immediately, the never starts (unless the entry is reque= ued-with-abort); your code would have the start, and then = get aborted when the entry call is completed. =20 If the trigger is an entry call and the entry is queued, *then* the abortab= le part is aborted when the entry call completes, not when it's selected. = =20 There are other cases where the language says the abortable part would neve= r start, but in your code above, it's nondeterministic whether your abortab= le part would start or not. Anyway, it's hard to say whether this involves a "hidden thread" or not. J= -P's statement makes no sense if we're talking about low-level or OS thread= s, since Ada says nothing about how tasks should be implemented, and it's p= ossible to write a tasking implementation in which there is only one OS thr= ead in which all tasks run, and there's nothing wrong with an implementatio= n creating a new "hidden" OS thread that is unconnected to a task if necess= ary. If we're talking about a conceptual kind of "thread", then we'd need = a better definition of what we're talking about. The RM uses the term "thr= ead of control" but never really defines it, but RM 9(1) says "Each task re= presents a separate thread of control that proceeds independently and concu= rrently between the points where it interacts with other tasks." In the co= ntext of the original question, I think that means that within a single tas= k, there cannot be two sequences of statements that are executing at the sa= me time, as the OP thought there were with the SELECT statement. How this = applies to ATC, I'm not sure. But I think it's still true that you cannot = have two statements in a single task executing at the same time, as long as= you don't consider a DELAY to be "executing" while it's delaying, or an en= try call to be "executing" when it's waiting for a rendezvous to complete. = =20 -- Adam