Recent questions tagged critical-section

3 3 votes
1 1 answer
90
90 views
For a correct mechanism controlling entry into a critical section, consider the following requirements:Two processes must not execute simultaneously inside their critical...
0 0 votes
0 0 answers
282
282 views
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-a...
0 0 votes
1 1 answer
350
350 views
Which of the following statements are CORRECT ?A process always check state of currently executing process to enter critical schema.Spin locks uses busy waiting.Periodica...
0 0 votes
1 1 answer
317
317 views
I have a question.If there is a hypothetical cs solution.In it 3 processes are waiting .whoever will get cpu will enter into the cs.Can that be called starvation?
0 0 votes
1 1 answer
391
391 views
Consider an operating system consisting of a pair of processes $P_{0}$ and $P_{1}$. The structure of each process $P_{\mathrm{i}}$ is shown below.while(TRUE){ j = 1-i; fl...
0 0 votes
1 1 answer
842
842 views
How to approach synchronization (specifically semaphore) question, there size are really intimidating and i’m unable to decode the code written? What to do??
0 0 votes
2 2 answers
2.2k
2.2k views
Sorry if this is a stupid question. But it really intrigued me. Same resources at different algorithms are telling different ways to test these stuffs.Here's an algorith...
0 0 votes
1 1 answer
611
611 views
In design protocol of critical section problem, each process must ask permission to enter critical section in ________ code; it then executes in the critical section; onc...
1 1 vote
2 2 answers
1.2k
1.2k views
Which of the following statements is false?a) Disjoint processes need not use critical sectionb) Programs with critical sections can never be use simultaneously by more t...
1 1 vote
2 2 answers
1.2k
1.2k views
Consider the following pseudo‐code for a process $\textsf{Pi},$ where $\textsf{“shared boolean flag ”}$ is a variable declared in shared memory, initialized as:flag[0] = ...
4 4 votes
0 0 answers
1.7k
1.7k views
Consider the following proposed solution to Dining Philosopher’s problem to avoid deadlock. The binary semaphore lock is initialized to 1.Which of the following is correc...
0 0 votes
1 1 answer
606
606 views
Part of a program where the shared memory is accessed and which should be executed indivisibly, is called:SemaphoresDirectoryCritical sectionMutual exclusion
0 0 votes
0 0 answers
1.1k
1.1k views
Consider the following program segments for two different processes (P1, P2) executing concurrently and where a and b are not shared variables, but x starts at zero and i...
0 0 votes
1 answers 1 answer
2.7k
2.7k views
​​​​​​​Suppose $P, Q$ and $R$ are co-operating processes satisfying Mutual Exclusion condition. Then, if the process $Q$ is executing in its critical section thenBoth $‘P...
0 0 votes
0 0 answers
2.9k
2.9k views
Many problems on gateoverflow asks whether the given code satisfies progress requirement of the solution for the critical section problem. Most of these code contain mult...
1 1 vote
1 1 answer
3.4k
3.4k views
Consider the followingProcess Piwhile(1){ while(turn != i); //critical section turn = j; //remainder section}Process Pjwhile(1){ while(turn != j); //critical ...
0 0 votes
0 0 answers
1.1k
1.1k views
Does Progress implies freedom from Deadlock?
0 0 votes
1 1 answer
713
713 views
Please describe the Deadlock Condition in synchronization and when will be synchronization possible and condition ..?
1 1 vote
2 2 answers
1.5k
1.5k views
does it guarantee mutual exclusion and deadlock prevention?
0 0 votes
0 0 answers
555
555 views
https://gateoverflow.in/1319/gate2009-33In this question progress is present or not?According to me making x=0 is exit part and not the reminder part. Hence I think progr...
0 0 votes
1 1 answer
1.2k
1.2k views
Consider the following solution for critical section problem with 'n' processes P0,P1,P2,......P(n-1).For all i,number[i] is an integer array initialized to zero, and for...
4 4 votes
3 3 answers
7.1k
7.1k views
Consider the following code to solve the critical section problem for two processes P0 and P1. Initially flag [i] contain false for i = 0 and 1.Assume i refers to the cur...
0 0 votes
0 0 answers
632
632 views
Is context switch allowed when a process is in the cirtical section? (Not preemption)If yes then how it deals with data inconsistency?
4 4 votes
1 1 answer
2.6k
2.6k views
Can a process be preempted while it is in a critical section?If yes, then how does the critical section or synchronisation mechanism concept provide solution for 'Data in...
1 1 vote
1 1 answer
2.9k
2.9k views
Q1. Consider the methods used by process P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared Boolean variables, ...
3 3 votes
0 0 answers
990
990 views
Let 'n' processes competing to enter their critical sections and mutex be a global binary semaphore initialized to 1. The process is coded as follows:Signal(mutex); C...