They're hard to get right (probably not a problem for Apple), and their overhead usually counterbalances any potential performance gains (possibly a problem for the unwary developer).
We've got some optimization work to do :-)
Obviously this can still be useful in read-heavy systems where the lock has to be held for long spans, but for our synchronized collections, we switched to std::mutex, which was massively faster.
Pet peeve: "insure" is used on the page. For some bizarre reasons Americans use that word when they mean "ensure". The difference is very important - insure is when you don't want something to happen and ensure is when you do!
http://stackoverflow.com/questions/1788690/objective-c-how-t...
http://www.cocoabuilder.com/archive/cocoa/224795-nsdictionar...
they make it impossible to test which a collection is.
Couldn't you just test with the following? // NSMutableDictionary
[dict respondsToSelector:@selector(setObject:forKey:]
// NSMutableArray
[arr respondsToSelector:@selector(addObject:)]
// NSMutableString
[str respondsToSelector:@selector(replaceCharactersInRange:withString:)]
// NSMutableSet
[set respondsToSelector:@selector(addObject:)]
Although, personally, I'd rather just, either at the class or method boundary depending on the circumstances, only expose the non-mutable variants.Example SO question: http://stackoverflow.com/questions/1788690/objective-c-how-t...
Another example discussion: http://www.cocoabuilder.com/archive/cocoa/224795-nsdictionar...
In this case, however, our goal was to take common, familiar interfaces and idioms in Objective C, and make them safer/more powerful.
Something more like channels-like would be quite useful, but it would likely be published under a different project.