in reply to Using forks and threads

I think mixing forking and threads is asking for trouble. (Particularly if you're on Win32 when forking is threads.)

Several people have reported good results using Parallel::ForkManager for things they otherwise might want to do with threads. I haven't used it personally, but there's a tutorial if you want to give it a try.

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Replies are listed 'Best First'.
Re^2: Using forks and threads
by ColinHorne (Sexton) on Jul 20, 2006 at 08:39 UTC
    Thanks xdg, I will look into this one. If the worst comes to the worst, I suppose I could always fork() before threading, and have the child act as a slave for the parent, fork()ing itself off to perform an exec() on demand, and returning the results to the parent.