in reply to Re: Re: Re: Re: 3 weeks wasted? - will threads help?
in thread 3 weeks wasted? - will threads help?
The parrents task is to grab the list of files (read all 20 directories) every x seconds fork and create a child that proccesses such list -- only to loop sleep and do it all over in x seconds. your only downside here is that the child has to (on average) execute faster than the sleep time of the parent otherwise you will slowly gain procs. I hope this clears it up.while (1) { $totallistoffiles = glob all_dir_list/*; fork if child { proccess file list exit } else #parrent { sleep 2 } }
|
|---|