[PLUG] perl advice (forking, lists problems)

Lennon Day-Reynolds lennon at day-reynolds.com
Wed Oct 23 20:57:24 UTC 2002


Is there any chance you could use Perl 5.8? If so, I would highly
recommend a multi-threaded, rather than forking, approach. If you fork
the "slave" processes, you have to do a full copy of their working data
(unless you're using shared memory, of course, which is far more complex
to use correctly than threads). Also, multiple threads can much more
easily share rich data structures (like intermediate results of work)
than multiple processes.

Of course, if this really is just a one-off script with a fixed data
set, you could also just let it run in a single 'niced' process for as
long as it needs to, rather than spending hours and hours trying to
optimize the processing time. Remember the old adage: programmer time is
exponentially more expensive than processor time.

Lennon Day-Reynolds
lennon at day-reynolds.com






More information about the PLUG mailing list