KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Apple says: Important: Instances of ABAddressBookRef can not be used by multiple threads. Each thread must make its own instance. But why? I know that some particular class or operations must be done in main thread. And I know some objects are not thread-safe (which means it would cause problem if these objects are accessed by two different threads concurrently). But, if you can make sure that the the thread-unsafe objects are accessed by only one thread at any moment, then there should be no problem. Do I understand correctly thus far? What I can't understand is, Why would some objects like ABAddressbookRef need to be created for each thread? Why would Apple say something like this? If it's just that it's thread-unsafe, Apple can says it's thread-unsafe, be careful when handling it. But why is there a need to create one for each thread? Is there any reason that I don't know? Does the implementation of ABAddressbookRef rely on the thread which created it? PS: I remember that Core Data also says ManagedObjectContext need to be creates for each thread which uses it.
Tags (comma-separated)
Save Edits
Cancel