my $q = Thread::Queue->new; ## create a new **EMPTY** queue my $done : shared; $done = 0; my $wget_thread = threads->create( \&wget_sub ); my $cpu_monitor_thread = threads->create( \&monitor_cpu ); ## Start your threads with the queue empty/ my $mem_monitor_thread = threads->create( \&monitor_mem )