comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Eachus <rieachus@comcast.net>
Subject: Re: How to tell whether program finalization can be suppressed
Date: Mon, 4 Dec 2017 06:36:16 -0800 (PST)
Date: 2017-12-04T06:36:16-08:00	[thread overview]
Message-ID: <81ab6eef-e4e0-40d4-a90e-4c207fa67b3e@googlegroups.com> (raw)
In-Reply-To: <d9039b0d-993b-49e1-9bde-6a079bddec65@googlegroups.com>

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:
> > > 
> > > Just to refresh my memory:
> > > The main subprogram is the master of any library tasks. It may be empty (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.
> > > 
> > > with Lib;  -- in the elaboration sequence, there are some tasks
> > > procedure Main is
> > > begin
> > >   null;  -- waiting here for tasks to terminate
> > > end Main;
> > 
> > No, the environment task is the master of library level tasks...
> 
> But that's what Randy wrote:
> "When the main program exits, of course the environment task completes and then
> terminates. It's the completion of the environment task that starts library-level finalization."
> So what did he want to say? Main resp. env task exits, completes, terminates... Normally, Randy is precise in what he says.

I wasn't disagreeing with Randy, except maybe to make it clearer that library 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 library-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 reassignment 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.


  reply	other threads:[~2017-12-04 14:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 21:39 How to tell whether program finalization can be suppressed Simon Wright
2017-12-01 22:43 ` Randy Brukardt
2017-12-02  9:48   ` Simon Wright
2017-12-04 20:18     ` Randy Brukardt
2017-12-04 22:41     ` Simon Wright
2017-12-02 11:12   ` AdaMagica
2017-12-03 17:16     ` Robert Eachus
2017-12-04 11:58       ` AdaMagica
2017-12-04 14:36         ` Robert Eachus [this message]
2017-12-04 17:16           ` AdaMagica
2017-12-04 18:21             ` Jeffrey R. Carter
2017-12-04 20:25             ` Randy Brukardt
2017-12-04 20:22         ` Randy Brukardt
2017-12-02  3:08 ` Robert Eachus
2017-12-27 15:49 ` Simon Wright
replies disabled

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