[Chicago-talk] Sharing data in threads

me at heyjay.com me at heyjay.com
Wed Jun 2 12:04:12 CDT 2004


I did, but Steve said I could, so I went back and re-read perlthrtut.
But I never saw your way in the tutorial.

I'll go back and try it like you said

Thanks
Jay
----- Original Message ----- 
From: "Stathy G Touloumis" <stouloumis at tungstenlearning.com>
To: "Chicago.pm chatter" <chicago-talk at mail.pm.org>
Sent: Wednesday, June 02, 2004 11:34 AM
Subject: Re: [Chicago-talk] Sharing data in threads


> I thought you asked this before :)
>
> How are you sharing the object?
>
> Use the function call with references :
> my $array = [];
> &share( $array );
> bless $array, $class;
>
> VS
>
> my $array : shared = [];
>
> "If you want to share a newly created reference unfortunately you need to
> use '&share([])' and '&share({})' syntax due to problems with Perl's
> prototyping."
>
>
> >In playing with threads, the only way I've found to share a complex
> >object is to do something like:
> >
> >my %data : shared;
> >my %hash : shared;
> >$data{hash} = \%hash;
> >
> >I'd rather do use anonymous hashes like:
> >
> >my $data : shared = {};
> >
> >But it doesn't (seem) to work.
> >
> >How do you construct and share a complex variable?
> >
> >Thanks
> >Jay
> >_______________________________________________
> >Chicago-talk mailing list
> >Chicago-talk at mail.pm.org
> >http://mail.pm.org/mailman/listinfo/chicago-talk
>
>
> Stathy G. Touloumis
>
> Application Development Manager, Benchmarks
> Edison Schools, Inc.
> Ph: 847.676.6663
>
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at mail.pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>
>




More information about the Chicago-talk mailing list