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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: How can one record component be local and another not? Date: Thu, 7 May 2020 13:58:43 +0200 Organization: Adalog Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 7 May 2020 11:58:43 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="ced0c648581b9efbbca2447b6507ef60"; logging-data="31058"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+oNuqIjpcuwxRSZp51NWuc" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cancel-Lock: sha1:/57b6Yf1uznofH/IiYxSxbcU9OE= In-Reply-To: Content-Language: fr Xref: reader01.eternal-september.org comp.lang.ada:58625 Date: 2020-05-07T13:58:43+02:00 List-Id: 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