- or download this
my $q = Thread::Queue->new; ## create a new **EMPTY** queue
...
my $cpu_monitor_thread = threads->create( \&monitor_cpu ); ## Start y
+our threads with the queue empty/
my $mem_monitor_thread = threads->create( \&monitor_mem )
- or download this
sub monitor_cpu {
...
}
return $cap;
}
- or download this
my $done :shared = 0;
...
## To stop the queue(s)
$done = 1;
$mon->join;