comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: Ada 2012 automatic concurrency?
Date: Thu, 27 Dec 2012 11:22:02 +0000 (UTC)
Date: 2012-12-27T11:22:02+00:00	[thread overview]
Message-ID: <kbhb0q$mqc$2@dont-email.me> (raw)
In-Reply-To: kbh2m0$sou$1@online.de

On Thu, 27 Dec 2012 09:59:44 +0100, Dirk Heinrichs wrote:

> charleshixsn@earthlink.net wrote:
> 
>> IIUC, there shouldn't be more than about twice as many tasks as cores. 
>> Is this about right?
> 
> Hmm, taking into account that your application isn't alone on your
> system and task switches have their price, too, I think you'd better go
> with "# of CPUs/Cores + 1", like the Gentoo Linux Handbook suggests for
> the level of parallel compilation:
> 
> "A good choice is the number of CPUs (or CPU cores) in your system plus
> one,
> but this guideline isn't always perfect." [1]
> 
> However, I'm still confused about the "+1".

Probably an attempt to ensure there is always one task waiting to do 
useful work when a currently running task suspends. 

I have my doubts about the "+1" too in practice, since it may mean tasks 
migrating between CPUs and trashing their caches.

There may be times when it is better to have "+1" per CPU, and mark each 
task with affinity for the CPU it starts out with. 

In any case, too many tasks means too much inactive state, which 
increases pressure on cache and slows up task swapping. So "+1" may be 
more of an ideal asymptotic target than a practical reality (like Colin 
Chapman's adage about the perfect race car - one that falls apart while 
crossing the finish line in first place).

It would be interesting to see some numbers though.

- Brian



  reply	other threads:[~2012-12-27 11:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-25 17:26 Ada 2012 automatic concurrency? charleshixsn
2012-12-26 22:02 ` John B. Matthews
2012-12-26 22:55 ` Niklas Holsti
2012-12-27  5:57   ` charleshixsn
2012-12-27  8:59     ` Dirk Heinrichs
2012-12-27 11:22       ` Brian Drummond [this message]
2012-12-27 22:13       ` Randy Brukardt
2012-12-27 14:27     ` Jeffrey Carter
2012-12-27 20:13       ` tmoran
2012-12-27 19:06     ` Niklas Holsti
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox