Thread-Specific StorageThe book has now been published and the content of this chapter has likely changed substanstially.
How can thread-unaware code access data specific to the thread.
Provide a 'logically global' object that provides access to a storage area specific to that thread.
The Thread-Specific Storage design pattern allows multiple threads to use one 'logically global' access point to retreive an object that is local to a thread, without incurring locking overhead on each object access.
The benefits of using Thread-Specific Storage pattern include efficiency, reusability, ease of use and portability. But it encourages the use of (thread specific) global objects. It also restricts implementation objects.
Further ReadingSee [POSA2].
Copyright © 2003-2008 Gerard Meszaros all rights reserved