CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced: Re: [budman] Release memory from threads: Edit Log



KingNothing
Novice

Feb 25, 2012, 1:52 PM


Views: 12873
Re: [budman] Release memory from threads

Hi, this is how i create the threads

Code
for($a=0;$a<=$counter;$a++){ 
if($choice==1){
$thr[$a] = threads->create({'exit'=> 'thread_only'},sub {&ext1::submit($file)});
}
else
{
$thr[$a] = threads->create({'exit'=> 'thread_only'},sub {&ext1::reset($file)});
}
$result[$a]=$thr[$a]->is_running();
}

I used semaphores th shut down the threads but then the memory in use just get doubled and reached 800Megabyte. I closed the whole process because soon it would get out of memory. I have read the doc on perldoc page for the threads but really can't find the way out.


(This post was edited by KingNothing on Feb 25, 2012, 1:55 PM)


Edit Log:
Post edited by KingNothing (Novice) on Feb 25, 2012, 1:55 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives