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…

The Implementation of Semaphores

Most contemporary computer architectures offer hardware support for process synchronization in the form of specialized machine instructions. The test-and-set instruction (TS) copies a variable into a register and sets the variable to zero in one indivisible machine cycle. Test-and-set has the form TS(R, x) where R is a register and x is a memory location and performs…

Semaphores

The software solution presented before only works if there is two processes competing for the same code block. Likewise, it is not real efficient if it needs to be used a lot. Semaphores are general-purpose primitives that allow solving a variety of synchronization problems in a systematic manner. A semaphore is a non-negative integer variable that…

Process Interactions

Concurrency is when multiple processes (or threads) execute at the same time. When multiple physical CPUs are available, the processes may execute in parallel. On a single CPU, concurrency may be achieved by time-sharing. There is a whole study in the process of parallel programming, where you design applications to run on multiple processors simultaneously to…

Combined Approaches

If you work with a system that only has batch processes, or only does real time applications, then your scheduling algorithm selection is much easier. You pick an appropriate choice and go with it… However, the modern desktop OS will often include a combination of batch, interactive, and real-time applications. Therefore picking “a” solution isn’t…

Scheduling Real-Time Processes

A real-time process is characterized by continual input, which must be processed fast enough to generate nearly instantaneous output. Each arriving input item is subject to a deadline. Ex: Streaming of audio or video, processing and displaying radar data, control of robots or of fly-by-wire aircraft. A period is a time interval (typically in milliseconds or even microseconds for…