in reply to Re: Protecting External Data?!
in thread Protecting External Data?!
you see, if you do this in Perl:
then $x will be copied to the new thread. but if you do this:my $x = 5; sub ct { threads->create(\&worker); }
$x won't be copied.sub ct { my $x = 5; threads->create(\&worker); }
I thought that if I keep my SV outside of Perl, it just won't be accessable and won't be copied. apperently I am wrong.
So I need help protecting my SV against the almighty thread duplicator. how can I do it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Protecting External Data?!
by plobsing (Friar) on Dec 20, 2007 at 07:04 UTC | |
by semuel (Novice) on Dec 22, 2007 at 18:13 UTC | |
by plobsing (Friar) on Dec 23, 2007 at 05:10 UTC |