comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: How can one record component be local and another not?
Date: Thu, 7 May 2020 13:58:43 +0200
Date: 2020-05-07T13:58:43+02:00	[thread overview]
Message-ID: <r90t5j$uai$1@dont-email.me> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2005071217060.1471015@hexenstieg>

Le 07/05/2020 à 12:31, Stefan.Lucks@uni-weimar.de a écrit :
> On Thu, 7 May 2020, J-P. Rosen wrote:
> 
>> No, tasks declared in library packages could survive the main program.
> 
> Correct me, if I am wrong, but my understanding has always been that the
> main program (or "environment task") can only terminate after all the
> tasks started within the main program have terminated (or, perhaps, have
> been aborted, or did run into an unhandled exception).
True AND False. The master of a library task is the environment task,
not the procedure declared as the main program. So you can return from
the main procedure, and then wait for the termination of library tasks.

The confusion is that the procedure declared as "main" is not the real
main program. The real main program is generated by the compiler, it
elaborates the library packages, and then calls the main procedure. In
gnat, you can even see the source (file b__*.adb)

>> You may even have a "begin null; end" main program, and do all the work
>> with library tasks.
> 
> Once again, my understanding is that a main program with the "begin
> null; end Program_Name" does not terminate, as long as one of its tasks
> is still running. 
As explained above, Program_Name terminates, but not the "real" main
program that called it.

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr

      reply	other threads:[~2020-05-07 11:58 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 11:04 How can one record component be local and another not? hreba
2020-05-05 11:33 ` AdaMagica
2020-05-05 11:38   ` AdaMagica
2020-05-05 12:59   ` hreba
2020-05-05 13:19     ` J-P. Rosen
2020-05-05 13:37     ` Jere
2020-05-05 14:28       ` hreba
2020-05-05 15:18         ` AdaMagica
2020-05-05 14:32   ` hreba
2020-05-05 11:43 ` AdaMagica
2020-05-05 12:55   ` hreba
2020-05-05 11:46 ` Simon Wright
2020-05-05 13:07   ` hreba
2020-05-05 17:00     ` Dmitry A. Kazakov
2020-05-05 11:48 ` Niklas Holsti
2020-05-05 13:44   ` hreba
2020-05-05 15:45 ` Jeffrey R. Carter
2020-05-05 17:17   ` hreba
2020-05-05 19:08     ` Niklas Holsti
2020-05-06 19:31       ` hreba
2020-05-09 19:43         ` Niklas Holsti
2020-05-10 15:10           ` hreba
2020-05-05 19:19     ` Jere
2020-05-06  6:42     ` Mark Lorenzen
2020-05-06  8:26       ` Simon Wright
2020-05-06  8:33         ` Mark Lorenzen
2020-05-05 17:32 ` hreba
2020-05-05 19:04   ` Niklas Holsti
2020-05-05 20:11     ` Niklas Holsti
2020-05-06 13:13       ` hreba
2020-05-06 17:30   ` Niklas Holsti
2020-05-06 18:28     ` Jere
2020-05-06 19:09       ` Niklas Holsti
2020-05-07  9:07     ` J-P. Rosen
2020-05-07 10:15       ` Niklas Holsti
2020-05-07 13:00         ` Egil H H
2020-05-07 13:25         ` Simon Wright
2020-05-07 10:31       ` Stefan.Lucks
2020-05-07 11:58         ` J-P. Rosen [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