Journal jeffy124's Journal: Perl Threads Question 6
Really simple yes/no question that seems to have no easy-to-find answer:
Do threads in Perl take advantage of multiple CPUs?? It's 5.6.1 on an i386-linux.
I've done countless google searches and the like, looked through the camel book, and have had no luck. I posted this to comp.lang.perl last week and the only response I got was "upgrade to 5.8," which is not an available option.
perl 5.6 doesnt support threads. (Score:1)
no idea about 5.8. i only heard 5.8 is dangerous because several tiny details aren't compatible with 5.6.
Re:perl 5.6 doesnt support threads. (Score:1)
forking might be an option, but the script might become part of something larger, so i prefer to have a bunch of lightweight processes running around.
Re:perl 5.6 doesnt support threads. (Score:1)
to test if perl threads can use multiple cpus, start a perl program with 2 threads and watch the output of ps. if the program appears twice, it can use both cpus. at least on linux this works, because linux displays threads as separated processes.
Re:perl 5.6 doesnt support threads. (Score:1)
Perl doesn't do the thread thing... (Score:1)
Quick note: This is from an old OS class I took in college, so my info may not be to date for the modern languages...
Re:Perl doesn't do the thread thing... (Score:1)
i realize the OS is a factor, but perl's interpreted, and nothing has explicitly said that multiple processors will be used if threads are used. For instance, Java used to support only user-threads, meaning the OS had no knowledge of threading, hence everything took place on one processor. Java now uses kernel threads, taking advantage of multiple cpu's.
The question really boils down to "Which does perl use - user threads or kernel threads?"