Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This is just an example where i tread the help sub. Sometimes i have HUGE subs running on public commands, some takes about 30 mins to complete. Thats why i need threads so the main code wont be locked up and wait for the sub to exit. So ppl can run parallell, Say 5 ppl type help at the same time they should all be served directly.if (lc substr($text,0,5) eq ".help") { my $info = substr($text,6); my $auth = autcheck($info, $event->{nick}, $event->{host}); $helpthr = threads->new(\&help); $helpthr->detach; }
Is there any other "simple" way to do this? I've tried forks but that didnt work good at all. Been reading a little about POE but just can figure out if it could be a sollution to my problem or not.
Please help a desperate dude out here :)
update (broquaint): fixed formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Threads Problem!
by liz (Monsignor) on Nov 03, 2003 at 11:57 UTC | |
by Phantazm (Initiate) on Nov 03, 2003 at 13:09 UTC | |
by liz (Monsignor) on Nov 03, 2003 at 14:34 UTC | |
by Phantazm (Initiate) on Nov 03, 2003 at 15:02 UTC | |
by liz (Monsignor) on Nov 03, 2003 at 16:12 UTC | |
| |
|
Re: Threads Problem!
by BrowserUk (Patriarch) on Nov 03, 2003 at 12:22 UTC | |
by Phantazm (Initiate) on Nov 03, 2003 at 14:05 UTC |