> > You aren't being clear here. > > > > fetch($a) fetch($a) > > fetch($b) ... > > add ... > > store($a) store($a) > > > > Now all of the perl internals are done 'safely' but the result is garbage. > > You don't even know the result of the addition. > > Sorry you are right, I wasn't clear. You are correct - the final value > of $a will depend on the exact ordering of the FETCHEs and STOREs in the > two threads. mmmm...I hadn't been thinking in terms of the stack machine. OK, we could put the internal locks around fetch and store. Now, can everyone deal with these examples Example $a = 0; $thread = new Thread sub { $a++ }; $a++; $thread->join; print $a; Output: 1 or 2 Example @a = (); async { push @a, (1, 2, 3) }; push @a, (4, 5, 6); print @a; Possible output: 142536 - SWM
- Re: RFC 178 (v2) Lightweight Threads Chaim Frenkel
- Re: RFC 178 (v2) Lightweight Threads Nick Ing-Simmons
- Re: RFC 178 (v2) Lightweight Threads Alan Burlison
- Re: RFC 178 (v2) Lightweight Threads Nick Ing-Simmons
- Re: RFC 178 (v2) Lightweight Threads Alan Burlison
- Re: RFC 178 (v2) Lightweight Threads Alan Burlison
- Re: RFC 178 (v2) Lightweight Threads Chaim Frenkel
- Re: RFC 178 (v2) Lightweight Threads Alan Burlison
- Re: RFC 178 (v2) Lightweight Threads Chaim Frenkel
- Re: RFC 178 (v2) Lightweight Threads Alan Burlison
- Re: RFC 178 (v2) Lightweight Threads Steven W McDougall
- Re: RFC 178 (v2) Lightweight Threads Steven W McDougall
- Re: RFC 178 (v2) Lightweight Threads Chaim Frenkel
- Re: RFC 178 (v2) Lightweight Threads Nick Ing-Simmons
- Re: RFC 178 (v2) Lightweight Threads Chaim Frenkel
- Re: RFC 178 (v2) Lightweight Threads Alan Burlison
- Re: RFC 178 (v2) Lightweight Threads Steven W McDougall
- Re: RFC 178 (v2) Lightweight Threads Bryan C . Warnock
- Re: RFC 178 (v2) Lightweight Threads Steven W McDougall
- Re: RFC 178 (v2) Lightweight Threads Nick Ing-Simmons
- Re: RFC 178 (v2) Lightweight Threads(multiversionning) raptor