> "BCW" == Bryan C Warnock <[EMAIL PROTECTED]> writes:
>> 3. Subroutines
>>
>> sub foo { print "foo" }
>>
>> Thread1 Thread2
>> foo(); eval 'sub foo { print "bar" }';
>>
>> This prints either "foo" or "bar".
>>
>> Thread2 replaces the coderef for &main::foo. Th
On Fri, 18 Aug 2000, Steven W McDougall wrote:
> Thread1 Thread2
> push @a, (1, 2, 3); push @a, (4, 5, 6);
>
> The interesting question is whether push is atomic.
Array operations should be atomic.
>
> Atomic
> @a is either (1, 2, 3, 4, 5, 6) or (4, 5, 6, 1, 2,
Steven W McDougall writes:
> 4. Regular expressions
> It seems like an RE match should be atomic, because it hard to imagine
> it executing sensibly if the target string changes during the match.
> But then we have
>
> Thread1 Thread2
> $a =~ s/.../.../e; $a
1. Scalars
Thread1 Thread2
$a = 1; $a = 2;
$a is set to 1 and then 2, or 2 and then 1. It just depends which
thread gets there first.
2. Arrays
Thread1 Thread2
push @a, (1, 2, 3); push @a, (4, 5, 6);
The interesting question