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.107.8.26 with SMTP id 26mr13589180ioi.27.1512398177162; Mon, 04 Dec 2017 06:36:17 -0800 (PST) X-Received: by 10.157.81.193 with SMTP id d1mr663935oth.13.1512398177058; Mon, 04 Dec 2017 06:36:17 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.kjsl.com!usenet.stanford.edu!193no1069570itr.0!news-out.google.com!s63ni3458itb.0!nntp.google.com!i6no2768073itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 4 Dec 2017 06:36:16 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8303:2100:5985:2c17:9409:aa9c; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8303:2100:5985:2c17:9409:aa9c References: <3dcad98b-d517-4c3a-a77b-dd584c143b2c@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <81ab6eef-e4e0-40d4-a90e-4c207fa67b3e@googlegroups.com> Subject: Re: How to tell whether program finalization can be suppressed From: Robert Eachus Injection-Date: Mon, 04 Dec 2017 14:36:17 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:49351 Date: 2017-12-04T06:36:16-08:00 List-Id: On Monday, December 4, 2017 at 6:58:48 AM UTC-5, AdaMagica wrote: > Am Sonntag, 3. Dezember 2017 18:16:47 UTC+1 schrieb Robert Eachus: > > On Saturday, December 2, 2017 at 6:12:13 AM UTC-5, AdaMagica wrote: > > >=20 > > > Just to refresh my memory: > > > The main subprogram is the master of any library tasks. It may be emp= ty (I just confirmed this with a little test) and thus does not exit until = all library tasks are terminated or waiting on a terminate alternative. > > >=20 > > > with Lib; -- in the elaboration sequence, there are some tasks > > > procedure Main is > > > begin > > > null; -- waiting here for tasks to terminate > > > end Main; > >=20 > > No, the environment task is the master of library level tasks... >=20 > But that's what Randy wrote: > "When the main program exits, of course the environment task completes an= d then > terminates. It's the completion of the environment task that starts libra= ry-level finalization." > So what did he want to say? Main resp. env task exits, completes, termina= tes... Normally, Randy is precise in what he says. I wasn't disagreeing with Randy, except maybe to make it clearer that libra= ry level tasks can continue to run after the main program completes. I was= disagreeing with your statement that the main program is the master of lib= rary-level tasks. Didn't matter in your example, but I could probably gin = up an example. Hmm. Something with Ada.Text_IO.File_Types and reassignmen= t of Current_Output? I usually keep the main program around to print out a = message when the program completes successfully, but that's personal style.