Thread-Local Variables
[Miscellaneous]

Collaboration diagram for Thread-Local Variables:


Detailed Description

The following are some of the thread-local variables defined in the storage manager libraries. (This is far from a complete list.)

Each use of TLS_STRUCT creates a thread_local object.

See also tls_tricks.


Variables

static __thread bool tls_tricks::tls_manager::_thread_initialized
static __thread latch_holder_tlatch_holder_t::thread_local_holders
 Linked list of all latches held by this thread.
static __thread latch_holder_tlatch_holder_t::thread_local_freelist
 Pool of unused latch_holder_t instances.


Variable Documentation

__thread latch_holder_t * latch_holder_t::thread_local_holders [static, inherited]

Linked list of all latches held by this thread.

Every time we want to grab a latch, we have to create a latch_holder_t; we do that with the holder_search class, which searches the per-thread list below to make sure we `(this thread) don't already hold the latch and if not, it creates a new latch_holder_t for the new latch acquisition, and stuffs the latch_holder_t in this list. If we do already have hold the latch in some capacity, the holder_search returns that existing latch_holder_t. So we can tell if this thread holds a given latch, and we can find all latches held by this thread, but we can't find all the holders of a given latch.

See also:
latch_holder_t

Definition at line 97 of file latch.h.

__thread latch_holder_t * latch_holder_t::thread_local_freelist [static, inherited]

Pool of unused latch_holder_t instances.

Ready for recycling. These structures are first taken from the global heap but put on this list for reuse rather than free-ed. When the thread is destroyed, the items on this list are returned to the global heap.

See also:
latch_holder_t

Definition at line 98 of file latch.h.


Generated on Mon Jan 2 15:14:02 2012 for Shore Storage Manager by  doxygen 1.4.7