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.36.7.1 with SMTP id f1mr2176489itf.0.1512168834679; Fri, 01 Dec 2017 14:53:54 -0800 (PST) X-Received: by 10.157.69.72 with SMTP id p8mr329293oti.4.1512168834610; Fri, 01 Dec 2017 14:53:54 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.kjsl.com!usenet.stanford.edu!193no947879itr.0!news-out.google.com!x87ni1212ita.0!nntp.google.com!193no947875itr.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 1 Dec 2017 14:53:54 -0800 (PST) In-Reply-To: <51a6bff7-ca9f-44d8-a00b-9068727fb104@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8303:2100:1cec:c0e3:c185:491d; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8303:2100:1cec:c0e3:c185:491d References: <7c246c12-77f6-45c9-a05a-9afe934df332@googlegroups.com> <705c80ad-2338-4c81-b2b5-d5ea5e2b5b62@googlegroups.com> <51a6bff7-ca9f-44d8-a00b-9068727fb104@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <67aa971f-9ea3-4a24-88d2-b3b4ec502451@googlegroups.com> Subject: Re: Strange warning message From: Robert Eachus Injection-Date: Fri, 01 Dec 2017 22:53:54 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:49317 Date: 2017-12-01T14:53:54-08:00 List-Id: On Wednesday, November 29, 2017 at 5:39:39 AM UTC-5, reinert wrote: > Sorry for showing a bit confusion here, but could you indicate in few wor= ds what is a "task declared at the library level" ? A task declared i packa= ge "above" the main program? Hmm. Library level is shorthand for a unit declared as a library unit, or = directly within a package that is a library unit. Of course, you can have = library units, like Ada.Text_IO.Open is a library level unit, even though i= t is nested in two packages. In general you want as much of your program declarations to be either withi= n the current unit, within the main program or at the library level. This = way the linker or loader has a static address for the variable, subroutine,= or whatever, rather than run-time code needing to go through a display or = a stack walk to find the right instance. Of course, if you use recursion, = you want to have many versions of a named object on the stack. ;-) Note th= at generic instantiations can be at the library level. Generic units even = if declared at the library level do not make their contents library level d= eclarations. Instantiating a generic at the library level can do that. For tasks, we have this additional constraint. You can't leave the scope i= n which a task is declared because the task can still access those objects.= So functions, procedures, tasks and even packages can need to wait for al= l the tasks declared locally to be completed (or waiting at a terminate alt= ernative). Again declaring library level tasks, if you don't need this com= plex behavior, eliminates run-time code to make it work.