>>>>> "SWM" == Steven W McDougall <[EMAIL PROTECTED]> writes:

>> Aha, I get it. -internals has been assuming that one _must_ specify
>> the sharing. You want it to be infered.

>> I think that's asking for too much DWIMery.

SWM> Question: Can the interpreter determine when a variable becomes
SWM> shared?

SWM> Answer: No. Then neglecting to put a :shared attribute on a shared
SWM> variable will crash the interpreter. This doesn't seem very Perlish.

Err, no. It won't crash the interpreter. It'll make the script operate
incorrectly.

SWM> Answer: Yes. Then the interpreter can take the opportunity to install
SWM> a mutex on the variable.

But do we want to? Perhaps we want to take away the value from the other
thread.

There are two different access that you weren't clear about. One is
access to the name ($a). The other is to the contents. In the case
of regular thingees, the name is the thingee. But the case is different
for references. There are two accesses needed. One to the name holding
the reference, the other is the referenced item.

I think what you are discussing is probably a reference.

        my $a :shared;
        my $b;
        $a = \$b;

Otherwise what is the problem. In this case. Putting a reference into
a shared variable would wrap the reference.

Would this satisfy your needs?

<chaim>
-- 
Chaim Frenkel                                        Nonlinear Knowledge, Inc.
[EMAIL PROTECTED]                                               +1-718-236-0183

Reply via email to