Deadlock, Concurrency and Semaphore


Deadlock describes a situation where two or more threads are blocked forever, waiting for each other.s Concurrency means multiple computations are happening at the same time.

Find Out More

Brief Explanation


Deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process. Consider an example when two trains are coming toward each other on the same track and there is only one track, none of the trains can move once they are in front of each other. Concurrency is the execution of the multiple instruction sequences at the same time. It happens in the operating system when there are several process threads running in parallel. The running process threads always communicate with each other through shared memory or message passing. Concurrency results in sharing of resources result in problems like deadlocks and resources starvation.

View Demo!

Deadlock


BANKER'S ALGORITHM

Tests for safety by simulating the allocation for predetermined maximum possible amounts of all resources, then makes an “s-state” check to test for possible activities..

More Info Demo

CONCURRENCY


As the name suggests, it replaces the newest page that arrived at last in the main memory.

LOCK VARIALBE

Simplest synchronization mechanism-implemented in User mode-used for more than two processes.// two values-0,1. 0 means critical section is vacant and 1 means critical section is occupied.

More Info Demo

TEST SET LOCK

Synchronization mechanism- uses test and set instructions to provide the synchronization among the processes executing concurrently.

More Info Demo

TURN VARIABLE

Software mechanism implemented at user mode-only for two processes. It is a lock shared by two processes.

More Info Demo

PETERSON METHOD

Concurrent programming algorithm for mutual exclusion that allows two or more processes to share a single-use resource without conflict, using only shared memory for communication.

More Info Demo

PRODUCER CONSUMER

Synchronization problem. The producer produces items and enters them into the fixed size buffer. The consumer removes the items from the buffer and consumes them

More Info Demo

SEMAPHORE


As the name suggests, this algorithm randomly replaces any page.

COUNTING SEMAPHORE

It uses a count that helps task to be acquired or released numerous times.

More Info Demo

BINARY SEMAPHORE

Has 0 and 1 value. The wait operation only works when the semaphore is 1 and the signal operation succeeds when semaphore is 0

More Info Demo