in reply to Re: How do I run subroutines in parallel?
in thread How do I run subroutines in parallel?
Unless you are running on a multiprocessor box or a cluster, 'parallel' really just means multiprocessing. If you fork coprocesses, they can get their own time slice whenever they are ready to run, so your job effectively gets more time from the system.Good point. My first reaction upon reading the question was that forking and threading can improve your performance ONLY when you've got tasks that have a lot of 'waiting time', such as retrieving a bunch of files over a network. Your point about there being more timeslices for the code when spread over more processes proved me wrong before making an ass of myself in public :-)
I do wonder if this makes a lot of difference when you don't have a lot of other processes running though, and wheter you cannot get the same sort of gain when you up (or lower, however you look at it) the priority on the process. Does anyone have any pointers to benchmarks/articles on this subject?
-- Joost downtime n. The period during which a system is error-free and immune from user input.
|
|---|