On onsdag, juli 24, 2002, at 10:48 , Elizabeth Mattijsen wrote:
> At 10:24 AM 7/24/02 +0200, Elizabeth Mattijsen wrote:
>>> In the future I hope to be able to clone just specific data that is
>>> needed for a thread, how this is supposed to work isn't really
>>> thought out yet, ideas welcome.
>> I was thinking of a combination of a new pragma (or possibly a
>> parameter to thread::shared) and a new attribute.
>> The attribute would be ": private", the opposite of shared. The
>> pragma would set the default for variables defined in the scope, to be
>> either shared or thread private.
>>
>> So:
>>
>> sub name {
>> use threads::shared ':all';
>> my $scalar; # would have : shared attribute
>> my $other : private; # would _not_ have : shared attribute
>> }
>
> Actually, I think we need a third attribute: ': public'.
>
> public current state if not shared: copied when cloning
> shared accessible to all threads, not copied
> private only accessible in thread, not copied
>
> An execution error should occur when you try to access a variable
> marked "private" that was not copied to your thread.
>
>
> Liz
>
>
Ick ick ick ick, we are mixing with OO syntax here :/
shared, unqiue, unshared is fine, let us not mix public private.
I am very sceptical against the lets share everything since it will slow
down code, just share what you really want to share.
Arthur