in reply to Locking hash values
my $scalar : shared = 0; my %hash; $hash{key} = \$scalar; lock $hash{key};
I'm not sure how reliable that is when you start new threads though. You're probably better off just sticking with a few shared scalars in my opinion. Perl's threading isn't one of it's strongest features. At least you're not stuck with IPC.
-Paul
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Locking hash values
by bucky0 (Initiate) on Dec 18, 2006 at 18:25 UTC | |
by ikegami (Patriarch) on Dec 18, 2006 at 18:36 UTC | |
by bucky0 (Initiate) on Dec 18, 2006 at 18:55 UTC | |
by caelifer (Scribe) on Dec 18, 2006 at 19:35 UTC | |
by ikegami (Patriarch) on Dec 18, 2006 at 19:45 UTC | |
by bucky0 (Initiate) on Dec 18, 2006 at 21:51 UTC |