Hi!, I understand that, to initialize the $pool ideally between daemon() and scan_files(), just after the fork. The code: .... daemon(); $pool = Thread::Pool->new( { optimize => 'memory', do => \&check_system, pre => sub {shift; print "starting a new work with\n" }, post => sub { print "stopping the work\n" }, frequency => 10, autoshutdown => 1, workers => 20, maxjobs => 100, minjobs => 10, } ); scan_files();
And the daemon() function implement the fork. Well, so the program does not work. The program execute, but does nothing. It was stopped without doing anything. Just run once while(1) of scan_files(). I think that is how should the $pool did not exist. 2008/7/29 Jerry D. Hedden <[EMAIL PROTECTED]>: >> First i initialice the pool and then i set the process as a daemon. Then i >> call the scan_files() function. > > Nope. That's no good. > >> I also test to initialice the pool inside the daemon() function > > Depends on where in daemon you do it - it must come after the fork. > >> and between daemon() and scan_files(). > > Better. > >> Doing that, the output is blank, but it doesn't work. > > Define "doesn't work". > -- A greeting, Javier.