Re: (forks) When do I need to lock variables?

2003-09-23 Thread Elizabeth Mattijsen
At 08:31 + 9/23/03, Steve Schein wrote: > In general, increment on a shared variable is not safe. It's safe in the sense that Perl won't crash. It's _not_ save in the sense that you might miss increments. This is because shared variables in Perl are implemented as tied variables, i.e. wi

Re: (forks) When do I need to lock variables?

2003-09-23 Thread Steve Schein
> In general, increment on a shared variable is not safe. It's safe in > the sense that Perl won't crash. It's _not_ save in the sense that > you might miss increments. This is because shared variables in Perl > are implemented as tied variables, i.e. with a FETCH and STORE. An > incremen

Re: (forks) warnings from forks.pm

2003-09-23 Thread Elizabeth Mattijsen
At 16:25 +0200 9/23/03, Per Buer wrote: I am getting quite a lot warnings from forks.pm; Use of uninitialized value in array element at /usr/lib/perl5/forks.pm line 1143. Use of uninitialized value in array element at /usr/lib/perl5/forks.pm line 1156. Use of uninitialized value in array element

Re: (forks) warnings from forks.pm

2003-09-23 Thread Elizabeth Mattijsen
At 16:25 +0200 9/23/03, Per Buer wrote: I am getting quite a lot warnings from forks.pm; Use of uninitialized value in array element at /usr/lib/perl5/forks.pm line 1143. Use of uninitialized value in array element at /usr/lib/perl5/forks.pm line 1156. Use of uninitialized value in array element

(forks) warnings from forks.pm

2003-09-23 Thread Per Buer
Hi, I am getting quite a lot warnings from forks.pm; Use of uninitialized value in array element at /usr/lib/perl5/forks.pm line 1143. Use of uninitialized value in array element at /usr/lib/perl5/forks.pm line 1156. Use of uninitialized value in array element at /usr/lib/perl5/forks.pm line 1143

Re: (forks) When do I need to lock variables?

2003-09-23 Thread Per Buer
On tirsdag 23 september 2003, 15:16, Elizabeth Mattijsen wrote: > > How > >about "$foo = scalar keys %HASH"? Should a wrap access to shared lists > >and hashed with tie and lock there? > > I'm not sure what you mean here... Oops. Should have been "Should _I_ wrap ...". I just want to count the nu

Re: (forks) When do I need to lock variables?

2003-09-23 Thread Elizabeth Mattijsen
At 13:52 +0200 9/23/03, Per Andreas Buer wrote: I've playing around with forks and forks::shared for some time now - it looks really nifty. In the past I've been spending too much time emulating threads in Perl. :/ I am not quite sure when I need to lock. Is "$HASH{foo}++" safe? In general, increme

(forks) When do I need to lock variables?

2003-09-23 Thread Per Andreas Buer
Hi. I've playing around with forks and forks::shared for some time now - it looks really nifty. In the past I've been spending too much time emulating threads in Perl. :/ I am not quite sure when I need to lock. Is "$HASH{foo}++" safe? How about "$foo = scalar keys %HASH"? Should a wrap access t