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.107.58.70 with SMTP id h67mr14079573ioa.38.1523075975702; Fri, 06 Apr 2018 21:39:35 -0700 (PDT) X-Received: by 2002:a9d:6050:: with SMTP id v16-v6mr574397otj.4.1523075975608; Fri, 06 Apr 2018 21:39:35 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!k65-v6no340648ita.0!news-out.google.com!u64-v6ni469itb.0!nntp.google.com!u184-v6no352320ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 6 Apr 2018 21:39:35 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=68.147.43.80; posting-account=lzqe5AoAAADHhp_gregSufVhvwu22fBS NNTP-Posting-Host: 68.147.43.80 References: <1aa8f536-250d-4bef-9392-4d936f916e5f@googlegroups.com> <9377f941-31d0-4260-818a-8e189aac8c19@googlegroups.com> <10e74e0c-119a-4d86-8a12-c05101f744f1@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Large number of tasks slows down my program (using debian) - any fix? From: Brad Moore Injection-Date: Sat, 07 Apr 2018 04:39:35 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 3103 X-Received-Body-CRC: 1077394031 Xref: reader02.eternal-september.org comp.lang.ada:51374 Date: 2018-04-06T21:39:35-07:00 List-Id: On Friday, April 6, 2018 at 9:48:31 AM UTC-6, Jeffrey R. Carter wrote: > On 04/05/2018 04:07 PM, Brad Moore wrote: > > > > https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/threadring-gnat-6.html Thanks for your comments, some interesting points and suggestions... > > The code as presented here doesn't compile: Create_Lightweight_Thread is called > before the body is elaborated. You are correct that technically the compiler would be right to complain here, but I tried the code and compiled it exactly as presented on the website, and it compiles fine for me. What version of compiler are you using? On an aside, This is the sort of error that Randy's compiler is good at catching. For my test, I was running GNAT GPL 2017. Thread model: posix gcc version 6.3.1 20170510 (for GNAT GPL 2017 20170515) (GCC) > > Correcting that, the code ran in about 25.3 s on a 4 GHz Core i7 (8 virtual > processors). About a factor of 1.9 from the results presented. > > I then made what seemed to me like fairly minor changes to the code. To my > surprise, the result ran in about 7.6 s. Applying the factor of 1.9 would put > this result in 3rd place. > > Functionally the 2 seem equivalent. Probably the most significant change is that > the protected entry became a protected procedure. I tried your version of the code with my version of the compiler, but the times for both versions were almost identical. It sounds like your compiler is quite different from the one I am using. I am running under Linux on an AMD quadcore system. regards, Brad Moore