in reply to Re: Re: Threads Problem!
in thread Threads Problem!
Could you elaborate on this? It should behave the same as threads. And I have not been able to reproduce it with a simple case. Are you sure they are zombies? Could it not be that something is keeping the forked processes alive in e.g. a DESTROY subroutine?
Liz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Threads Problem!
by Phantazm (Initiate) on Nov 03, 2003 at 15:02 UTC | |
Now i'm trying forks. It's actually working real good the only problem is that it doesnt exits the sub routines. Say my script is test.pl When someone does !help on irc in channel it starts my help sub then a ps -x shows another test.pl that confirms that the sub is running. When the sub is done it doesnt kill the newly created test.pl So after 300 ppl have done !help there are 300 test.pl running :) If i end the sub with exit; the entire script dies. Using threads with same script it starts a thread (a new test.pl shows in ps -x) after its done the extra test.pl dissapears just as i want it, but with this code i got the severe memory leak So i'm pretty close now i think :) just need it to exit the sub correctly so it closes. I start the sub with this syntax. I have tried to end the help sub with exit; and return; all it does is kill the entire bot, It only works if i restart the irc loop when the sub ends with
Thank you yet again for taking time to help me. | [reply] [d/l] [select] |
by liz (Monsignor) on Nov 03, 2003 at 16:12 UTC | |
Please try to re-create the problem with as little source as possible. I cannot reproduce the behaviour on my systems, so it must be something specific to your situation that is causing the zombies. What OS are you using anyway? Maybe the problem is OS related. Liz | [reply] |
by Anonymous Monk on Nov 03, 2003 at 16:44 UTC | |
i'm running Linux merlin 2.4.20-gentoo-r7 #5 SMP Wed Oct 22 01:11:47 CEST 2003 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux I try thread exit and then write a little sample for you :) | [reply] |
by Anonymous Monk on Nov 03, 2003 at 19:54 UTC | |
This is a sample of code that exists. i've left all the use module::module; for you to see what i use in the entire bot. This bot just sends TEST TEST to a user who does .help With threaded perl it works good. starts a process then it exits it when done but loads alot of memory. With forks it works but it doesnt end the process, the extra bot.pl is still there when ps -aux | grep bot.pl bot.pl This is the help_module.pl I'm really stuck on this :/ I dont have a singel clue. Might be my irc module thas poorly written to. Hope you get something out of it :) /Chris | [reply] [d/l] [select] |