Shared Memory Manager

The Shared Memory Manager provides two kinds of operating systems support to Minibase: It provides the lowest levels of semaphores, which are required to provide locking and mutual exclusion, and a collection of methods using which shared memory may be instantiated and accessed.

Design Decisions

The system maintains an array of available semaphores and assigns them, as they are requested. A Shared Memory class object is responsible for allocating chunks of shared memory as and when required. It also maintains some book-keeping information about the shared memory. A shared memory manager (ShMemMgr) class object keeps track of all global pointers to the shared memory region and provides methods to access these pointers.

A point to note when observing the public interface is that the SharedRegion class is the base class from which shared data structures like the Lock table are derived. The SharedRegion class contains a semaphore. If a class is derived from this base class, it thus contains a semaphore and can call the lock and unlock methods provided for semaphores. Each method of the derived class may be sandwiched between a lock and an unlock call. It is therefore appropriate for a class to be derived from the base SharedRegion when the methods of the derived class are naturally formed units of mutual exclusion. The definitions of the buffer manager indicate that the BufMgr class is not a derived class of the class SharedRegion. This is because we would like the granularity of latching to be at the level of buffer frames, rather than the entire buffer pool.

Click here for the public interface.
Click here for details of the shared mem module.

Back to the List of Components
Back to the Minibase Home Page