articles icon indicating copy to clipboard operation
articles copied to clipboard

Fixed wrong statement about thread safety of formatters

Open valeriyvan opened this issue 9 years ago • 3 comments

Fixed wrong statement about thread safety of NSDateFormatter and NSNumberFormatter

valeriyvan avatar Mar 20 '16 23:03 valeriyvan

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.

chriseidhof avatar Mar 21 '16 06:03 chriseidhof

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

valeriyvan avatar Mar 21 '16 07:03 valeriyvan

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.

valeriyvan avatar Mar 21 '16 08:03 valeriyvan