concurrency
GATE CSE & IT · Operating Systems - Concurrency and Synchronization · 2001-2024
Study anchor
Source-book anchor pending for this concept.
Practice action
Start latest PYQPYQs in this concept
All concepts →Consider the following two threads T1 and T2 that update two shared variables a and b. Assume that initially a = b = 1. Though context switching between threads can happen at any t...
Consider a multi-threaded program with two threads T1 and T2. The threads share two semaphores: s1 (initialized to 1) and s2 (initialized to 0). The threads also share a global var...
Consider the following two threads T1 and T2 that update two shared variables a and b. Assume that initially $a = 1$ and $b = 1$. Though context switching between threads can happe...
Consider a multi-threaded program with two threads T1 and T2. The threads share two semaphores: s1 (initialized to 1) and s2 (initialized to 0). The threads also share a global var...
Consider the following pseudocode, where S is a semaphore intialized to 5 in line#2 an counter is a shared variable intialized to 0 in line#1. Assume that the increment operation i...
The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently. P1( ) { C = B – 1; B = 2 * C; } P2( ) { D = 2 * B; B = D - 1; } The n...
A shared variable x, initialized to zero, is operated on by four concurrent processes W, X, Y, Z as follows. Each of the processes W and X reads x from memory, increments by one, s...
Barrier is a synchronization construct where a set of processes synchronizes globally i.e. each process in the set arrives at the barrier and waits for all others to arrive and the...
Barrier is a synchronization construct where a set of processes synchronizes globally i.e. each process in the set arrives at the barrier and waits for all others to arrive and the...
Which level of locking provides the highest degree of concurrency in a relational database?
Consider Peterson’s algorithm for mutual exclusion between two concurrent processes i and j. The program executed by process is shown below. Repeat flag[i]=true; turn=j; while (P)...