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!reader02.eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: About protected objects: entries with barriers depending on external data = bad practice ? Date: Sun, 12 Nov 2017 08:15:52 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="a4860bcc43682441526b98cfed35d44a"; logging-data="21410"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197BwX361vp9XWg4AwvmvFNczF7hgZqbZI=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:RWVfxoPfjjZtZyzpldy0n6266WQ= sha1:FPUfIPFgbwiYs96wvDN/tUsGc1Y= Xref: feeder.eternal-september.org comp.lang.ada:48836 Date: 2017-11-12T08:15:52+00:00 List-Id: "Dmitry A. Kazakov" writes: > On 2017-11-12 06:23, reinert wrote: > >> Assume a protected entry with a barrier depending on external data - >> and it is waiting for its barrier to become true. It must be >> laborious to check the barrier depending on something "far-far away"? >> How is this checking done in practice? The entry waits for other >> entries, procedures or functions and when they arrive, it may start >> before them? Or something more efficient? > > Barrier is evaluated only when required to. E.g. in the case of a > protected object after you leave an object's procedure or > entry. Updates from outside are most likely ignored. GNAT generates a barrier-evaluation function which is called as Dmitry says. If that function (i.e. the entry condition) involves external data then the external data will be considered, but only at that time.