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!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Interresting difference in Normal-Returns/Expression-Functions and Extended-Returns. Date: Wed, 1 May 2013 21:20:07 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <97967083-d21d-4de2-aeb8-76d0d5818993@googlegroups.com> <1b3buvosg9fcq$.z1uq1tdfril2$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1367461218 27181 69.95.181.76 (2 May 2013 02:20:18 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 2 May 2013 02:20:18 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:15283 Date: 2013-05-01T21:20:07-05:00 List-Id: "Shark8" wrote in message news:e0c67da2-159a-4a37-b199-1d80312f6aca@googlegroups.com... ... >> Delay >> also causes context switching. When you use null statement the main task >> likely to manage to create all contestant before any of them gains the >> processor (depending on OS settings and number of cores available). >I have four cores; that shouldn't be a problem though -- I'm using the >protected >object to manage my text-output debugging. But doing that is a Bounded_Error (see 9.5.1(8-18), and specifically paragraph 18). It of course might work as you intend (that's one of the possible results), but its something you should avoid in code unless you never, ever expect to run it on a different Ada compiler. To do this correctly, you have to use a lock object, typically wrapped in a controlled object so that initialization does the locking and finalization does the unlocking (that way you don't have to worry about abort or exceptions screwing up your locking). I'll leave the code needed as an exercise for the OP. :-) Randy.