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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,344faf475a6f812a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.96.225 with SMTP id dv1mr14027338wib.6.1366658034574; Mon, 22 Apr 2013 12:13:54 -0700 (PDT) Path: hg5ni13384wib.1!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.139.MISMATCH!xlned.com!feeder7.xlned.com!feeder.erje.net!eu.feeder.erje.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Interresting difference in Normal-Returns/Expression-Functions and Extended-Returns. Date: Mon, 22 Apr 2013 21:13:47 +0200 Organization: cbb software GmbH Message-ID: <1b3buvosg9fcq$.z1uq1tdfril2$.dlg@40tude.net> References: <97967083-d21d-4de2-aeb8-76d0d5818993@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: rHWOzyHApalsT5sEUcbvVQ.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2013-04-22T21:13:47+02:00 List-Id: On Mon, 22 Apr 2013 11:27:09 -0700 (PDT), Shark8 wrote: > I recently ran into unexpected behavior in the differences between a > normal return and an extended return [in GNAT]: namely an extended return > used to generate items in an array of tasks will *ALWAYS* execute in a > sequential manner whereas the array generated with an expression-function > or normal return is executed simultaneously. > > Is there some subtle difference in the extended return that I'm unaware of? (Is this a bug?) No difference (tested under Windows). Issues with the code: 1. Add 2 s delay in each test in order to see all tasks completed. 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). 2. The code leaks memory. I am sure you know that. 3. Do not return anonymous access objects created by allocator new. It is almost always a bug. 4. Keywords to be written all lower case, if you want others be able to read your code. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de