
KingNothing
Novice
Feb 25, 2012, 1:52 PM
Views: 9520
|
|
Re: [budman] Release memory from threads
|
|
|
Hi, this is how i create the threads
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)
|