Thread-local storage

suggest change

Every thread has a mutable dictionary local to that thread. You can cache information there without locking, because each thread has its own dictionary:

NSMutableDictionary *localStorage = [NSThread currentThread].threadDictionary;
localStorage[someKey] = someValue;

The dictionary is automatically released when the thread terminates.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents