Re: [swift-dev] Thread safety of weak properties

2015-12-14 Thread Mike Ash via swift-dev
> On Dec 14, 2015, at 3:19 PM, Greg Parker via swift-dev > wrote: > > >> On Dec 14, 2015, at 9:47 AM, John McCall via swift-dev >> wrote: >> >>> On Dec 12, 2015, at 7:04 PM, Chris Lattner wrote: >>> #3 sounds like a great approach to me. I agree with Kevin that if we keep >>> the object h

Re: [swift-dev] Thread safety of weak properties

2015-12-12 Thread Mike Ash via swift-dev
On Dec 12, 2015, at 3:29 AM, Kevin Ballard via swift-dev wrote: > > On Sat, Dec 12, 2015, at 12:01 AM, Kevin Ballard wrote: >> Another possible fix is to just atomically load/store the Value pointer >> itself (assuming all platforms Swift runs on supports lock-free atomic >> pointers). This wa

Re: [swift-dev] Thread safety of weak properties

2015-12-11 Thread Mike Ash via swift-dev
> On Dec 10, 2015, at 10:55 PM, John McCall wrote: > > The intent is that weak references do not need to be safe against read/write > and write/write races. They do need to be safe against read/destroy and > write/destroy races (by “destroy”, I mean destruction of the object, not the > weak

[swift-dev] Thread safety of weak properties

2015-12-10 Thread Mike Ash via swift-dev
Hello, world! First, congratulations on the whole open source thing. I'm really pleased to see how the team set it up and how well it's going. Blew away my expectations. Anyway, on to the thing. I was looking through the standard library's implementation of weak references, as one does, and no