Thread-local storage

suggest change

Every thread has access to a mutable dictionary that is local to the current thread. This allows to cache informations in an easy way without the need for locking, as each thread has its own dedicated mutable 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