>On Mon, Aug 26, 2013 at 8:39 PM, Kevin Ballard <ke...@sb.org> wrote: > On Aug 26, 2013, at 2:46 PM, Daniel Micay <danielmi...@gmail.com> wrote: > >> On Mon, Aug 26, 2013 at 5:36 PM, Flaper87 <flape...@gmail.com> wrote: >>> I also think Python's argumented assignments are fine and both a += b vs a + >>> b should behave differently. I personally read a += b as an atomic, >>> thread-safe operation whereas a + b isn't and I beleive that's the way it >>> shoud be. Expanding a += b to a + b doesn't sound right to me. >>> >>> Anyway, that's my $0.02. >>> >>> FF >> >> In C/C++/Python/Rust, `+=` isn't an atomic operation. Although, in the >> safe subset of Rust code there's no way to race on mutable data due to >> the inability to share it without locking. > > My understanding of Python's GIL is that += is indeed atomic because the GIL > only locks/unlocks around statements (though I don't believe this is > intentional). Though this certainly isn't the case for C/C++. > > -Kevin
The GIL is an implementation detail of CPython, and doesn't exist in Jython or IronPython since it's not part of the language. _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev