race condition
GATE CSE & IT · Operating Systems - Concurrency/Synchronization · 1998-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 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 the two functions incr and decr shown below. incr() { wait(s); X = X+1; signal(s); } decr() { wait(s); X = X-1; signal(s); } There are 5 threads each invoking incr once, a...
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...
When the result of a computation depends on the speed of the processes involved there is said to be