On Aug 26, 2013, at 2:46 PM, Daniel Micay <[email protected]> wrote:
> On Mon, Aug 26, 2013 at 5:36 PM, Flaper87 <[email protected]> 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 _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
