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.174.35 with SMTP id x35mr10597817ioe.106.1522937224179; Thu, 05 Apr 2018 07:07:04 -0700 (PDT) X-Received: by 2002:a9d:5220:: with SMTP id e32-v6mr1243488oth.3.1522937224092; Thu, 05 Apr 2018 07:07:04 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!k65-v6no5751968ita.0!news-out.google.com!15-v6ni1887itg.0!nntp.google.com!u184-v6no7543204ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 5 Apr 2018 07:07:03 -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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <10e74e0c-119a-4d86-8a12-c05101f744f1@googlegroups.com> Subject: Re: Large number of tasks slows down my program (using debian) - any fix? From: Brad Moore Injection-Date: Thu, 05 Apr 2018 14:07:04 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:51340 Date: 2018-04-05T07:07:03-07:00 List-Id: Another data point is the entry I submitted to the Computer Language Benchm= ark Games site for the Thread-Ring benchmark. The problem there is to create 503 tasks, and then use some sort of message= passing to pass a "token" in a ring from from task to the next, 50_000_000= times, printing out the task number that ended up with the token at the en= d. I used a protected object to pass a "token" between the tasks. I believe th= e reason why it works as fast as it did, is that an Ada protected object ca= n have one task perform the action of the protected object on behalf of oth= er tasks that are queued on an entry of the protected object. Source code: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/threadr= ing-gnat-6.html The results comparing this version against other approaches in other langua= ges can be seen here, where the entries are executed on a quad-core machine= : Note, the approaches by different languages are very different from each ot= her, so in some sense, this is like comparing apples and oranges. https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/thr= eadring.html All the benchmarks can be accessed from the top level of the site https://benchmarksgame-team.pages.debian.net/benchmarksgame/ Brad.