On Tuesday, September 2, 2003, at 11:51 PM, Bryan Harris wrote:

Thanks for the info, James. Sounds like threading is still a ways over my
head, but forking sounds interesting.


I have a perl script that does simple find-replaces within all the files
passed to it (the key parts were written by very kind people on this list,
actually). Would it be advantageous for the script to fork so that it could
be find-replacing on all files simultaneously as opposed to serially?

I seriously doubt it. It's usually a bad idea to make anything more complicated than strictly needed.


Multiprocessing is a lot of work, mostly because you have to control how information is shared between the two processes/threads. For example, even in a simple find and replace script, each part would have to know which files were being handled by the other processes/threads.

Save forking and threading for when you absolutely must do two or more things at once, say in servers, complex GUIs, etc.

Hope that helps.

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to