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.224.10.6 with SMTP id n6mr9006439qan.4.1367469695541; Wed, 01 May 2013 21:41:35 -0700 (PDT) X-Received: by 10.50.170.68 with SMTP id ak4mr3124404igc.1.1367469695456; Wed, 01 May 2013 21:41:35 -0700 (PDT) Path: border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!news.glorb.com!m7no139368qam.0!news-out.google.com!ef9ni42704qab.0!nntp.google.com!m7no139362qam.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 1 May 2013 21:41:35 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.20.190.126; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 69.20.190.126 References: <97967083-d21d-4de2-aeb8-76d0d5818993@googlegroups.com> <1b3buvosg9fcq$.z1uq1tdfril2$.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0a444657-4d36-480d-b05b-026bfa6b15cb@googlegroups.com> Subject: Re: Interresting difference in Normal-Returns/Expression-Functions and Extended-Returns. From: Shark8 Injection-Date: Thu, 02 May 2013 04:41:35 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Original-Bytes: 3077 Xref: number.nntp.dca.giganews.com comp.lang.ada:181353 Date: 2013-05-01T21:41:35-07:00 List-Id: On Wednesday, May 1, 2013 8:20:07 PM UTC-6, Randy Brukardt wrote: > "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). I thought I remembered something about it being questionable/implementation-defined if it would work as expected -- but it did work on the initial experiment (which was actually on tasks w/ discriminants). > It of course might work as you intend (that's one of the possible results), *nod* > but its something you should avoid in code unless you never, ever expect to > run it on a different Ada compiler. Right. > 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. :-) I see. I've been putting off getting into finalization... oh, hey, what about tasks as fields of records... ;)