next up previous contents
Next: Error Handling Up: The Shore Storage Manager Previous: Crash Recovery Facilities

 

Thread Management

Providing the facilities to implement a multi-threaded server capable of managing multiple transactions is one of the distinguishing features of the SSM. Other persistent storage systems such as the Exodus Storage Manager (http://www.cs.wisc.edu/exodus/)) only support writing clients that run one transaction at a time and are usually single-threaded.

The Shore Thread Package is documented in intro(sthread) All threads are derived from the abstract base class sthread_t. Any thread that uses the SSM facilities must be derived from class smthread_t described in smthread_t(ssm)

A discussion of how to use threads facility is given in the tutorial.

Any program using the thread package automatically has one thread, the one running main(). In addition, the SSM starts one thread to do background flushing of the buffer pool and another to take periodic checkpoints.

We have also implemented some extensions to the thread package. These are not formally part of the thread package, but we've found them useful enough in building the SSM and the Shore VAS to warrant including them as part of the documented interface.

 

Latches

Latches are a read/write synchronization mechanism for threads, as opposed to locks which are used for synchronizing transactions. Latches are much lighter weight than locks, have no symbolic names, and have no deadlock detection. Latches are described in latch_t(common)

 

Thread-Protected Hash Tables

The Resource Manager, rsrc_m, template class manages a fixed size pool of shared resources in a multi-threaded environment. The rsrc_m protects each resource with a latch and uses them to enforce a protocol in which multiple threads have consistent and concurrent access to the shared resources. For instance, the Shore buffer manager uses rsrc_m to manage buffer control blocks. The rsrc_m is implemented using a hash table. When a entry needs to be added and the table is full, on old entry is removed based on an LRU policy. More details can be found in rsrc(common)



next up previous contents
Next: Error Handling Up: The Shore Storage Manager Previous: Crash Recovery Facilities



Marvin Solomon
Fri Aug 2 13:40:00 CDT 1996