[Rd] [R] multithreading calling from the rpy Python package

René J.V. Bertin rjvbertin at gmail.com
Fri Oct 20 16:11:11 CEST 2006


Since Python has been mentioned in this context: Could not Python's
threading model and implementation serve as a guideline?

>From a few simple benchmarks I've run, it seems as if the Python
interpreter itself is thread-safe but not threadable. That is, when I
run something "pure Python" like a recursive function that returns the
nth Fibonacci number in parallel, there is no speed-up for 2 threads
on a dual-processor machine. However, calling sleep in parallel does
scale down with the number of threads, even on a single-processor ;)

Real-life code does tend to speed up somewhat, though never as much as
one would hope.

Just an idea...

René




More information about the R-devel mailing list