in reply to Forking Multiple Threads
Do you understand the difference between fork and threads?
fork creates a copy of the complete process, the "child". All changes made in the child stay with the child. Once the child exits, all the changes are lost.
You might want to read some of the recent posts about fork, such as Fork Sharing Globals or Forks (not waiting for children).
If you are just confused about your terminology, and say "fork" when you mean "start a thread", then maybe your problem stems from parts of your code that you did not show. Maybe you are not ->joining your threads.
As to your general structure, I highly recommend feeding a few worker threads from a Thread::Queue instead of launching 100 or more threads. If your threads are mostly downloading data, it could also be interesting to use one of the asynchronous frameworks, like AnyEvent::HTTP or a dedicated framework like WWW::Curl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Forking Multiple Threads
by anshumangoyal (Scribe) on Feb 08, 2012 at 11:55 UTC | |
by Corion (Patriarch) on Feb 08, 2012 at 12:02 UTC | |
by anshumangoyal (Scribe) on Feb 08, 2012 at 12:18 UTC | |
by BrowserUk (Patriarch) on Feb 08, 2012 at 12:55 UTC | |
by Corion (Patriarch) on Feb 08, 2012 at 12:24 UTC |