[Python-ideas] solving multi-core Python
Sturla Molden
sturla.molden at gmail.com
Thu Jun 25 17:25:41 CEST 2015
On 25/06/15 16:31, Nick Coghlan wrote:
> 3. The potential for collisions between objects means it isn't an
> embarrassingly parallel problem where the different computational
> threads can entirely ignore the existence of the other threads
Well, you can have a loop that updates all particles, e.g. by calling a
coroutine associated with each particle, and then this loop is an
embarrassingly parallel problem. You don't need to associate each
particle with its own thread.
It is bad to teach students to use one thread per particle anyway.
Suddenly they write a system that have thousands of threads.
Sturla
More information about the Python-ideas
mailing list