in reply to Perl threads loss of performance with system call
I run above code on fedora and I didn't observe any problem, but then again I don't know what is proper! If you provide a Short, Self-Contained, Correct Example which makes it clear to distinguish between correct and incorrect results I will give it a try.
You should be aware that there are quite a few ways of running a system command via Perl. And some of them involve running it via a shell, and some don't. Also a system command involves a fork. An exec does not, it replaces the current process with the system command. And of course there are various higher-level ways of spawning a system command like IPC::Run. Do you see the problem with all of them? or some of them? Have you also tried to run parallel sleep() from within the shell, avoiding perl to see if that's a perl problem?
bw, bliako
Update:
for long sleep: real 1m40.444s user 0m1.271s sys 0m8.883s for short sleep: real 0m1.901s user 0m1.442s sys 0m6.836s
Update2: use dmesg and check log files to see if the OS complains that certain quota on resources have been exceeded and it can't allocate more (perhaps too many open filehandles? a backticks-system will return back the STDOUT of the command). Use strace -fp PID to see exactly what's going on if you can seave through the maze of output.). Perhaps relevant: GNU-Parallel is an *excellent* tool for spawning commands in parallel and it is written in Perl.
|
---|