in reply to detach for threads
use threads; my $thr = threads->create(\&sub1); # Spawn the thread $thr->detach(); # Now we officially don't care any more sleep(15); # Let thread run for awhile sub sub1 { $a = 0; while (1) { $a++; print("\$a is $a\n"); sleep(1); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: detach for threads
by exilepanda (Friar) on Nov 15, 2011 at 09:46 UTC | |
by zentara (Cardinal) on Nov 15, 2011 at 10:44 UTC | |
by Sewi (Friar) on Nov 15, 2011 at 11:00 UTC | |
by Anonymous Monk on Nov 15, 2011 at 11:22 UTC |