good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^2: When to use forks, when to use threads ...?by Krambambuli (Curate) |
on Sep 05, 2008 at 08:36 UTC ( [id://709201]=note: print w/replies, xml ) | Need Help?? |
Usually it involves reusing threads.... don't detach them and expect them to go away.... threads must return or reach the end of their code block to be joined, or self-destruct if detached. Maybe your database connection isn't finishing completely I'm not sure I correctly understand what you are saying. My threads where intended to last practically forever, each thread handling one distinct and 'private' database connection. The memory leak was showing up during normal operation of the threads - apparently with each thread-switch - and I checked of course that my code would not 'grow' with a simple equivalent nonthreaded counterpart. Krambambuli ---
In Section
Seekers of Perl Wisdom
|
|