From: Brad Moore <bmoore.ada@gmail.com>
Subject: Re: Benchmarks Game: Thread ring (Was: Large number of tasks slows down my program (using debian) - any fix?)
Date: Fri, 6 Apr 2018 21:28:40 -0700 (PDT)
Date: 2018-04-06T21:28:40-07:00 [thread overview]
Message-ID: <4d3e18c3-2b55-4ec8-af5a-f811fd1f5a6b@googlegroups.com> (raw)
In-Reply-To: <87po3cvpst.fsf_-_@jacob-sparre.dk>
On Thursday, April 5, 2018 at 11:59:00 PM UTC-6, Jacob Sparre Andersen wrote:
> Brad Moore <bmoore.ada@gmail.com> writes:
>
> > [...] I believe the reason why it works as fast as it did, is that an
> > Ada protected object can have one task perform the action of the
> > protected object on behalf of other tasks that are queued on an entry
> > of the protected object.
>
> > The results comparing this version against other approaches in other
> > languages can be seen here, where the entries are executed on a
> > quad-core machine:
>
> > https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/threadring.html
>
> From the CPU load data, it looks like the Ada solution has four tasks
> running full time, and not just a single one.
>
Yes, in fact this appears to be the only example that fully loads all the cores. Some of the language examples only involve 1 core, which to me suggests that what is really happening in those cases is something more like a coroutine, which I think is not really a fair comparison.
When I said one task can service the queue on behalf of other tasks, I was thinking that the implementation might be "passing" the baton between the "pseudo"-threads maybe 503 passes at a time, releasing the 503 Ada tasks that are waiting on the entry, then those 503 tasks would queue back up on the entry (not necessarily all 503 at a time), but however many do get in at a time (based on how many are queued on the entry when the entry guard is opened), they would effectively get released at approximately the same time, but still in a serial order. So, I would expect all cores to be fully loaded. I don't know if GNAT actually has the protected object implemented this way, I just know that that is a possible (and I think recommended) implementation.
Cheers,
Brad
next prev parent reply other threads:[~2018-04-07 4:28 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-28 18:06 Large number of tasks slows down my program (using debian) - any fix? reinert
2018-03-28 18:49 ` Dennis Lee Bieber
2018-03-28 19:06 ` Paul Rubin
2018-03-28 19:21 ` Dmitry A. Kazakov
2018-03-28 20:17 ` reinert
2018-03-29 8:46 ` reinert
2018-03-29 9:18 ` Dmitry A. Kazakov
2018-03-29 15:39 ` Jeffrey R. Carter
2018-04-15 5:20 ` reinert
2018-03-29 22:33 ` Shark8
2018-03-30 9:04 ` Dmitry A. Kazakov
2018-03-30 20:46 ` Paul Rubin
2018-03-31 0:09 ` Randy Brukardt
2018-03-31 6:00 ` Paul Rubin
2018-03-31 9:37 ` Jacob Sparre Andersen
2018-03-31 10:44 ` Dmitry A. Kazakov
2018-04-02 3:35 ` Randy Brukardt
2018-04-02 6:23 ` alby.gamper
2018-04-02 7:12 ` alby.gamper
2018-04-05 14:07 ` Brad Moore
2018-04-05 15:09 ` Dmitry A. Kazakov
2018-04-07 4:16 ` Brad Moore
2018-04-05 15:30 ` Jeffrey R. Carter
2018-04-05 19:33 ` Spiros Bousbouras
2018-04-05 19:44 ` Simon Wright
2018-04-05 20:25 ` Jeffrey R. Carter
2018-04-06 5:58 ` Benchmarks Game: Thread ring (Was: Large number of tasks slows down my program (using debian) - any fix?) Jacob Sparre Andersen
2018-04-07 4:28 ` Brad Moore [this message]
2018-04-06 15:48 ` Large number of tasks slows down my program (using debian) - any fix? Jeffrey R. Carter
2018-04-07 4:39 ` Brad Moore
2018-04-07 8:15 ` Jeffrey R. Carter
2018-04-07 16:28 ` Brad Moore
2018-04-07 18:41 ` Jeffrey R. Carter
2018-04-08 0:29 ` Brad Moore
2018-04-08 8:25 ` Jeffrey R. Carter
2018-04-08 0:06 ` Robert I. Eachus
2018-04-07 16:51 ` Brad Moore
2018-04-07 12:21 ` Simon Wright
2018-04-07 16:57 ` Brad Moore
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox