objcio / articles

All current objc.io articles
593 stars 122 forks source link

Fixed wrong statement about thread safety of formatters #128

Open valeriyvan opened 8 years ago

valeriyvan commented 8 years ago

Fixed wrong statement about thread safety of NSDateFormatter and NSNumberFormatter

chriseidhof commented 8 years ago

Hm, great point. But I think it's slightly more complicated even. Even if the properties themselves have atomic getters and setters, the fact that the object is mutable at all makes it unsafe for multi-threaded programming... I'm not sure what's the best way to word this.

valeriyvan commented 8 years ago

I just cited Apple docs in footnote. May be it does make sense add a ref to Apple docs in footnote as well.

valeriyvan commented 8 years ago

If Apple states these are thread safe in iOS 7+, I believe them. It's interesting how they achieved that. Lock free structures? Good question to ask in labs in WWDC.