Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Search results for operating-system+process-synchronization
112
votes
7
answers
1
GATE CSE 2016 Set 1 | Question: 50
Consider the following proposed solution for the critical section problem. There are $n$ processes : $P_0....P_{n-1}$. In the code, function $\text{pmax}$ ... in the critical section at any time The bounded wait condition is satisfied The progress condition is satisfied It cannot cause a deadlock
Consider the following proposed solution for the critical section problem. There are $n$ processes : $P_0....P_{n-1}$. In the code, function $\text{pmax}$ returns an inte...
Sandeep Singh
47.5k
views
Sandeep Singh
asked
Feb 12, 2016
Operating System
gatecse-2016-set1
operating-system
process-synchronization
difficult
ambiguous
+
–
106
votes
8
answers
2
GATE CSE 2012 | Question: 32
Fetch_And_Add(X,i) is an atomic Read-Modify-Write instruction that reads the value of memory location $X$, increments it by the value $i$, and returns the old value of $X$. It is used in the pseudocode shown below to implement ... take on a non-zero value when the lock is actually available works correctly but may starve some processes works correctly without starvation
Fetch_And_Add(X,i) is an atomic Read-Modify-Write instruction that reads the value of memory location $X$, increments it by the value $i$, and returns the old value of $X...
gatecse
30.0k
views
gatecse
asked
Sep 26, 2014
Operating System
gatecse-2012
operating-system
process-synchronization
normal
+
–
122
votes
7
answers
3
GATE CSE 2017 Set 1 | Question: 27
A multithreaded program $P$ executes with $x$ number of threads and uses $y$ number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock $l$, then it cannot re-acquire lock $l$ without releasing ... $x = 1, y = 2$ $x = 2, y = 1$ $x = 2, y = 2$ $x = 1, y = 1$
A multithreaded program $P$ executes with $x$ number of threads and uses $y$ number of locks for ensuring mutual exclusion while operating on shared memory locations. All...
Arjun
33.3k
views
Arjun
asked
Feb 14, 2017
Operating System
gatecse-2017-set1
operating-system
process-synchronization
normal
+
–
57
votes
10
answers
4
GATE CSE 2007 | Question: 58
Two processes, $P1$ and $P2$, need to access a critical section of code. Consider the following synchronization construct used by the processes: /* P1 */ while (true) { wants1 = true; while (wants2 == true); /* Critical ... waiting. It requires that processes enter the critical section in strict alteration. It does not prevent deadlocks, but ensures mutual exclusion.
Two processes, $P1$ and $P2$, need to access a critical section of code. Consider the following synchronization construct used by the processes:/* P1 */ while (true) { wa...
Kathleen
27.7k
views
Kathleen
asked
Sep 21, 2014
Operating System
gatecse-2007
operating-system
process-synchronization
normal
+
–
51
votes
14
answers
5
GATE CSE 1997 | Question: 6.8
Each Process $P_i, i = 1\ldots 9$ is coded as follows repeat P(mutex) {Critical section} V(mutex) forever The code for $P_{10}$ is identical except it uses V(mutex) in place of P(mutex). What is the largest number of processes that can be inside the critical section at any moment? $1$ $2$ $3$ None
Each Process $P_i, i = 1\ldots 9$ is coded as followsrepeat P(mutex) {Critical section} V(mutex) foreverThe code for $P_{10}$ is identical except it uses V(mutex) in plac...
Kathleen
25.1k
views
Kathleen
asked
Sep 29, 2014
Operating System
gate1997
operating-system
process-synchronization
normal
+
–
115
votes
6
answers
6
GATE CSE 2013 | Question: 39
A certain computation generates two arrays a and b such that $a[i] = f(i)$ for $0 \leq i < n$ and $b[i] = g(a[i])$ for $0 \leq i < n$. Suppose this computation is decomposed into two concurrent processes $X$ and $Y$ such that $X$ computes the array $a$ and $Y$ computes the ... EntryY(R, S) { V(S); P(R); } ExitX(R, S) { V(R); P(S); } EntryY(R, S) { V(S); P(R); }
A certain computation generates two arrays a and b such that $a[i] = f(i)$ for $0 \leq i < n$ and $b[i] = g(a[i])$ for $0 \leq i < n$. Suppose this computation is decompo...
Arjun
28.4k
views
Arjun
asked
Sep 24, 2014
Operating System
gatecse-2013
operating-system
process-synchronization
normal
+
–
61
votes
6
answers
7
GATE CSE 2010 | Question: 45
The following program consists of $3$ concurrent processes and $3$ binary semaphores. The semaphores are initialized as $S0=1, S1=0$ and $S2=0.$ ... $P0$ print '$0$'? At least twice Exactly twice Exactly thrice Exactly once
The following program consists of $3$ concurrent processes and $3$ binary semaphores. The semaphores are initialized as $S0=1, S1=0$ and $S2=0.$$$\begin{array}{|l|l|}\hli...
go_editor
26.2k
views
go_editor
asked
Sep 30, 2014
Operating System
gatecse-2010
operating-system
process-synchronization
normal
+
–
75
votes
11
answers
8
GATE IT 2005 | Question: 41
Given below is a program which when executed spawns two concurrent processes : semaphore $X : = 0 ;$ /* Process now forks into concurrent processes $P1$ & $P2$ ... (II) are true. (I) is true but (II) is false. (II) is true but (I) is false Both (I) and (II) are false
Given below is a program which when executed spawns two concurrent processes :semaphore $X : = 0 ;$/* Process now forks into concurrent processes $P1$ & $P2$ */$\begin{ar...
Ishrat Jahan
24.0k
views
Ishrat Jahan
asked
Nov 3, 2014
Operating System
gateit-2005
operating-system
process-synchronization
normal
+
–
61
votes
9
answers
9
GATE CSE 2013 | Question: 34
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, stores it to memory, and then terminates. Each of the ... initialized to two. What is the maximum possible value of $x$ after all processes complete execution? $-2$ $-1$ $1$ $2$
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, ...
Arjun
22.7k
views
Arjun
asked
Sep 24, 2014
Operating System
gatecse-2013
operating-system
process-synchronization
normal
+
–
104
votes
6
answers
10
GATE CSE 2006 | Question: 61
The atomic fetch-and-set $x, y$ instruction unconditionally sets the memory location $x$ to $1$ and fetches the old value of $x$ in $y$ without allowing any intervening access to the memory location $x$ ... a pair of normal load/store can be used The implementation of $V$ is wrong The code does not implement a binary semaphore
The atomic fetch-and-set $x, y$ instruction unconditionally sets the memory location $x$ to $1$ and fetches the old value of $x$ in $y$ without allowing any intervening a...
Rucha Shelke
27.7k
views
Rucha Shelke
asked
Sep 26, 2014
Operating System
gatecse-2006
operating-system
process-synchronization
normal
+
–
69
votes
6
answers
11
GATE CSE 2015 Set 3 | Question: 10
Two processes $X$ and $Y$ ... proposed solution guarantees mutual exclusion and prevents deadlock The proposed solution fails to prevent deadlock and fails to guarantee mutual exclusion
Two processes $X$ and $Y$ need to access a critical section. Consider the following synchronization construct used by both the processes$$\begin{array}{|l|l|}\hline \text...
go_editor
20.8k
views
go_editor
asked
Feb 14, 2015
Operating System
gatecse-2015-set3
operating-system
process-synchronization
normal
+
–
59
votes
5
answers
12
GATE CSE 2001 | Question: 2.22
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) do no-op; Enter critical section, perform actions, then exit critical section Flag[i] = ... i flag[j] = true and turn = j flag[i] = true and turn = j flag[i] = true and turn = i
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 = ...
Kathleen
27.0k
views
Kathleen
asked
Sep 14, 2014
Operating System
gatecse-2001
operating-system
process-synchronization
normal
+
–
45
votes
5
answers
13
GATE CSE 2010 | Question: 23
Consider the methods used by processes $P1$ and $P2$ for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables $S1$ and $S2$ ... ? Mutual exclusion but not progress Progress but not mutual exclusion Neither mutual exclusion nor progress Both mutual exclusion and progress
Consider the methods used by processes $P1$ and $P2$ for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables...
go_editor
17.9k
views
go_editor
asked
Sep 29, 2014
Operating System
gatecse-2010
operating-system
process-synchronization
normal
+
–
26
votes
5
answers
14
GATE CSE 1992 | Question: 02,x, ISRO2015-35
At a particular time of computation, the value of a counting semaphore is $7$. Then $20$ $P$ operations and $15$ $V$ operations were completed on this semaphore. The resulting value of the semaphore is : $42$ $2$ $7$ $12$
At a particular time of computation, the value of a counting semaphore is $7$. Then $20$ $P$ operations and $15$ $V$ operations were completed on this semaphore. The resu...
Kathleen
23.9k
views
Kathleen
asked
Sep 12, 2014
Operating System
gate1992
operating-system
semaphore
easy
isro2015
process-synchronization
+
–
55
votes
7
answers
15
GATE CSE 2003 | Question: 81
Suppose we want to synchronize two concurrent processes $P$ and $Q$ using binary semaphores $S$ and $T$. The code for the processes $P$ and $Q$ ... $1$ $V(S)$ at $W, V(T)$ at $X, P(S)$ at $Y, P(T)$ at $Z, S$ and $T$ initially $1$
Suppose we want to synchronize two concurrent processes $P$ and $Q$ using binary semaphores $S$ and $T$. The code for the processes $P$ and $Q$ is shown below.$$\begin{ar...
go_editor
15.1k
views
go_editor
asked
Apr 24, 2016
Operating System
gatecse-2003
operating-system
process-synchronization
normal
+
–
61
votes
13
answers
16
GATE CSE 2009 | Question: 33
The enter_CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows: void enter_CS(X) { while(test-and-set(X)); } void leave_CS(X) { X = 0; } In the above solution, $X$ is a memory location ... at the same time Which of the above statements are TRUE? (I) only (I) and (II) (II) and (III) (IV) only
The enter_CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows:void enter_CS(X) { while(test-an...
Kathleen
25.0k
views
Kathleen
asked
Sep 22, 2014
Operating System
gatecse-2009
operating-system
process-synchronization
normal
+
–
21
votes
4
answers
17
GATE CSE 2021 Set 1 | Question: 46
Consider the following pseudocode, where $\textsf{S}$ is a semaphore initialized to $5$ in line $\#2$ and $\textsf{counter}$ is a shared variable initialized to $0$ in line $\#1$. Assume that the increment operation in line $\#7$ ... is $0$ after all the threads successfully complete the execution of $\textsf{parop}$ There is a deadlock involving all the threads
Consider the following pseudocode, where $\textsf{S}$ is a semaphore initialized to $5$ in line $\#2$ and $\textsf{counter}$ is a shared variable initialized to $0$ in li...
Arjun
13.5k
views
Arjun
asked
Feb 18, 2021
Operating System
gatecse-2021-set1
multiple-selects
operating-system
process-synchronization
semaphore
2-marks
+
–
33
votes
5
answers
18
GATE CSE 1996 | Question: 2.19
A solution to the Dining Philosophers Problem which avoids deadlock is to ensure that all philosophers pick up the left fork before the right fork ensure that all philosophers pick up the right fork before the left fork ensure that one particular ... the right fork, and that all other philosophers pick up the right fork before the left fork None of the above
A solution to the Dining Philosophers Problem which avoids deadlock is toensure that all philosophers pick up the left fork before the right forkensure that all philosoph...
Kathleen
11.1k
views
Kathleen
asked
Oct 9, 2014
Operating System
gate1996
operating-system
process-synchronization
normal
+
–
42
votes
5
answers
19
GATE IT 2008 | Question: 53
The following is a code with two threads, producer and consumer, that can run in parallel. Further, $S$ and $Q$ are binary semaphores quipped with the standard $P$ and $V$ operations. semaphore S = 1, Q = 0; integer x; producer: ... lost Values generated and stored in '$x$' by the producer will always be consumed before the producer can generate a new value
The following is a code with two threads, producer and consumer, that can run in parallel. Further, $S$ and $Q$ are binary semaphores quipped with the standard $P$ and $V...
Ishrat Jahan
9.8k
views
Ishrat Jahan
asked
Oct 28, 2014
Operating System
gateit-2008
operating-system
process-synchronization
normal
+
–
42
votes
8
answers
20
GATE CSE 2016 Set 2 | Question: 48
Consider the following two-process synchronization solution. ... synchronization solution. This solution violates mutual exclusion requirement. This solution violates progress requirement. This solution violates bounded wait requirement.
Consider the following two-process synchronization solution.$$\begin{array}{l|l}\hline \text{PROCESS 0 } & \text{Process 1 }\\ \\ \text{Entry: loop while (turn == 1);...
Akash Kanase
15.1k
views
Akash Kanase
asked
Feb 12, 2016
Operating System
gatecse-2016-set2
operating-system
process-synchronization
normal
+
–
Page:
1
2
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register