At 10:33 PM 7/24/02 +0100, Dave Mitchell wrote:
>On Wed, Jul 24, 2002 at 10:02:36PM +0200, Elizabeth Mattijsen wrote:
> > - using the ": shared" attribute is _not_ a way to save memory, quite the
> > contrary.  It uses even _more_ memory than unshared.  This seems
> > counter-intuitive to me and may be a bug.
>The main point of :shared is not to save memory, but to allow multiple
>threads access to the same data. From perlthrtut:
>    Also note that under the current implementation, shared variables use
>     a little more memory and are a little slower than ordinary variables.

I have looked a lot at perlthrtut, but this didn't register then.  Thanks 
for the confirmation...


>Each shared var has an emptyish SV per thread which has attached magic
>that allows it to access the contents of the real var.

That explains the benchmark that I saw so far.  But does this also explain 
the strange numbers for my $var : unique?  That seems to be the worst, 
memory wise...


Liz

Reply via email to