Threadpools, difference between DMD and LDC

Russel Winder via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Aug 4 11:22:38 PDT 2014


On Mon, 2014-08-04 at 16:57 +0000, Dicebot via Digitalmars-d-learn
wrote:
[…]
> This is why I had "or close" remark :) Exact number almost always 
> depends on exact deployment layout - i.e. what other processes 
> are running in the system, how hardware interrupts are handled 
> and so on. It is something to decide for each specific 
> application. Sometimes it is even best to have amount of worker 
> threads _less_ than amount of CPU cores if affinity is to be used 
> for some other background service for example.

David chose to have the pool thread default be (number-of-cores - 1) if
I remember correctly. I am not sure he manipulated affinity. This ought
to be on the list of things for a review of std.parallelism.

[…]

> Actually with CSP / actor model one can simply consider 
> long-running CPU computation as form of I/O an apply same 
> asynchronous design techniques. For example, have separate 
> dedicated thread running the computation and send input there via 
> message passing - respond message will act similar to I/O 
> notification from the OS.

Now you are on my territory :-) I have been banging on about message
passing parallelism architectures for >25 years, but sadly shared memory
multi-threading became the standard model for some totally bizarre
reason. Probably everyone was taught they had to use all the wonderful
OS implementation concurrency techniques in all their applications
codes.

CSP is great, cf. Go, Python-CSP, GPars, actors are great, cf. Erlang,
Akka, GPars, but do not forget dataflow, cf. GPars, Actian DataRush.

There have been a number of PhDs trying to provide tools for deciding
which parallelism architecture is best suited to a given problem. Sadly
most of them have been ignored by the programming language community at
large.

> Choosing optimal concurrency architecture for application is 
> probably even harder problem than naming identifiers.

'Fraid not, it's actually a lot easier.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20140804/0726f653/attachment.sig>


More information about the Digitalmars-d-learn mailing list