in reply to Re: What is a shared variable?
in thread What is a shared variable?
#!/usr/bin/perl -- use threads; use threads::shared; my $foo = 0 x ( 100 * 1024 ); share($foo); threads->create(sub { $foo.= 1 x ( 100 * 1024); })->join(); sleep 10;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: What is a shared variable?
by dave_the_m (Monsignor) on Dec 31, 2009 at 13:04 UTC |