Memory Paging

The main disadvantage of dividing memory into variable partitions is external fragmentation, which requires the searching of memory for holes large enough to satisfy each request. As we’ve mentioned previously, swapping or compaction is necessary when no hole large enough is available. A page is a fixed-size contiguous block of a logical address space identified by the…

Requirements for Efficient Memory Management

Logical vs Physical memory A computer’s physical memory (RAM) is a hardware structure consisting of a linear sequence of words that hold a program during execution. A word is a fixed-size unit of data. The size of a word is reflected in many aspects of a computer’s structure and operation. A typical word size is 4 to 8 bytes…

Unit Tests

Unit testing is a form of software testing where you test small individual “units” of code. Each unit tested might be associated with a small sub-section, like a function. The associated control data, usage procedures, and operating procedures, are tested to determine whether the unit is ready for use, or at least the next set…

Deadlock Detection

A deadlock in a resource allocation graph can be detected by executing a graph reduction algorithm by repeating this process: Select an unblocked process p. Remove p, including all request and allocation edges connected to p. Anything left is blocked, and risks deadlock. However, it is considered completely reducible if there are no processes left…

A System Model for Deadlocks

A resource allocation graph shows the current allocation of resources to processes and the current requests by processes for new resources. Processes are represented by circles. Resources are represented by rectangles. Small circles designate multiple units within a resource. Resource allocations are represented by edges directed from a resource to a process. Resource requests are represented by…

Classic Synchronization Problems

The Readers-Writers Problem The readers-writers problem is an extension of the critical section problem where two types of processes, readers and writers. However, it involves an interesting issue when the processes compete for access to a common resource. Multiple readers are allowed to enter the critical section concurrently but only one writer is allowed to…

Monitors

P and V operations on general semaphores are versatile primitives capable of solving a variety of synchronization problems. But they are low-level primitives, prone to difficult-to-diagnose programming errors. (see the issues that we need to avoid in Process Interactions – those are some of the errors you might run into.) A monitor is a high-level synchronization primitive…