From: Brad Moore <brad.moore@shaw.ca>
Subject: Re: can someone help me with this code (explanation)
Date: Wed, 01 Oct 2014 09:38:48 -0600
Date: 2014-10-01T09:38:48-06:00 [thread overview]
Message-ID: <9eVWv.147739$_r4.8604@fx25.iad> (raw)
In-Reply-To: <m0f93l$8do$1@dont-email.me>
On 14-09-30 03:59 PM, Georg Bauhaus wrote:
> On 30.09.14 06:22, Brad Moore wrote:
>> In fact, only the Go and the Haskell entries are consistently ahead of
>> this latest version for all 4 processor configurations. The Ada
>> version has 503 tasks executing with calls on a protected entry (where
>> each task maps to an OS thread in GNAT). Looking at the Go example,
>> I'm guessing that the 503 lightweight threads are being executed by a
>> single OS thread, likely under a work-stealing scheduler, where the
>> work never gets stolen by other cores, since this benchmark mostly
>> involves a sequential handoff of a token to the next thread. It that's
>> whats happening, then it might explain why the Go version is still
>> quite a bit faster, since executing the problem on the same core
>> doesn't require as much overhead and locking to do the handoff.
>>
>>
>
> FWIW, adding (to #6)
>
> delay 0.0;
>
> to the task body after the conditional loop exit resulted in some
> changes in running time, on my testing machines. Results depend very
> much on the compiler, and on (absence of) optimization.
> Nothing like the order of magnitude of #6, though.
>
> (On GNU/Linux: the system compiler (Debian, gcc 4.4.5) and GNAT 2013
> 4.7.4; Xeon E5-2620, two cores of a KVM.)
>
I tried your suggestion on my system. Ubuntu/Linux GPL 2014 compiler AMD
quadcore, but this added 20-30 seconds to the processing time unfortunately.
Incidentally, I believe the reason approach #6 works is because the task
executing a protected entry can execute the protected action on behalf
of the other tasks that have passed the guard on that protected entry.
(See RM 9.5.3 22-23)
next prev parent reply other threads:[~2014-10-01 15:38 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-25 13:44 can someone help me with this code (explanation) Stribor40
2014-09-25 14:56 ` Björn Lundin
2014-09-25 15:01 ` Björn Lundin
2014-09-25 15:54 ` Stribor40
2014-09-25 17:11 ` Niklas Holsti
2014-09-25 19:41 ` Stribor40
2014-09-25 19:53 ` Jeffrey Carter
2014-09-25 20:10 ` Niklas Holsti
2014-09-25 22:27 ` Jeffrey Carter
2014-09-26 7:04 ` Björn Lundin
2014-09-26 7:58 ` J-P. Rosen
2014-09-26 10:24 ` G.B.
2014-09-26 11:48 ` Björn Lundin
2014-09-26 12:49 ` J-P. Rosen
2014-09-26 14:15 ` Björn Lundin
2014-09-26 14:49 ` J-P. Rosen
2014-09-26 15:31 ` Björn Lundin
2014-09-26 16:08 ` G.B.
2014-09-30 4:22 ` Brad Moore
2014-09-30 21:59 ` Georg Bauhaus
2014-10-01 15:38 ` Brad Moore [this message]
2014-09-26 16:23 ` Dmitry A. Kazakov
2014-09-26 20:38 ` J-P. Rosen
2014-09-27 18:16 ` Björn Lundin
2014-09-26 16:43 ` Niklas Holsti
2014-09-26 16:45 ` Niklas Holsti
2014-10-09 2:45 ` Randy Brukardt
2014-09-26 16:44 ` Niklas Holsti
2014-09-26 5:06 ` J-P. Rosen
2014-09-25 16:53 ` Jeffrey Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox