template<typename P>
class maxon::ThreadLocalPointer< P >
Thread local pointer (to a data structure). Different threads may use this class to store different (local) values to it. These values are typically pointers to data which is to be used by the calling thread only.
- Note
- Thread local pointers are a scarce resource. Only a limited number of them can be allocated: On Windows about 1000 and on OS X about 500. You should only use them if they are the last and only resort to solve a problem. Furthermore for performance reasons it is best to avoid thread local pointers at all and instead use some sort of local context (for a group's jobs or with ParallelFor).
-
A thread local pointer is bound to a OS thread and the pointer is stored for the lifetime of the thread.