in reply to Perl Threads and multi-core CPUs
The bigger issue is that it seems that Perl threads live INSIDE the spawning process, so they don't get scheduled on separate CPUs but simply compete for run time within the spawning process.
Wherever did you get that idea from? Because it is totally wrong.
Perl's threads are underlain by system threads, whether on Win32 or *nix, and as such, get scheduled by the system and are eligable to run on all available processors. (Unless you take extraordinary steps to prevent them from doing so.)
I tried some tests and indeed on Linux the "top" command shows only one Perl process running on one of the 8 available CPUs even though I have 8 threads running.
Top is fooling you.
|
|---|