#!/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;
In reply to Re^2: What is a shared variable?
by Anonymous Monk
in thread What is a shared variable?
by llancet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |