in reply to Re: Completely Random Stall
in thread Completely Random Stall
#! /usr/bin/perl use threads; $|++; print "Running...\n"; while(1){ opendir(DIR2,"./bgthread/process"); @list3 = readdir(DIR2); close( +DIR2); $line = ""; @items = ""; foreach (@list3){ $line = $_; chomp($line); if (($line ne ".") && ($line ne "..")){ ($buffer,$do,$torrent) = split(/\-\.\-/,$line); print "Sending ($line)\n"; $thr = threads->new(\&do_thread); $thr->detach; } } if (-e "./bgthread_refresh"){ exit; } sleep(1); #system("sleep 0.5"); print ":"; } sub do_thread(){ system("perl bgthread_processor.pl $line"); #goto ¬hing; } sub nothing(){ #Do nothing... undef $line; }
|
|---|