It does not do anything with $thr.
Exactly. You are throwing it (them, one for each thread you create) away. So don't do that, save them.
my @threads; for (0 ..3)) { my $thr = threads->create( sub { worker(); } ); $thr->detach(); push @threads, $thr; } ... # then later for my $thr ( @threads ) { print 'Thread ', $thr->tid, $thr->is_running ? ' is running' : ' is not running';
In reply to Re^3: Monitor list of threads running
by BrowserUk
in thread Monitor list of threads running
by mr_p
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |