Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [critical-section]

The tag has no usage guidance.

0
votes
2answers
44 views

Whats exact definition of 'atomicity' in programming?

the definition of 'atomicity' says that a transaction should be able to be terminated without being touched or manipulated by possibly concurrent running actions during its process. But does that also ...
0
votes
0answers
140 views

Two Process Solution for Critical Section Problem- Algorithm 1

I have started learning Critical Section Problem and its various solutions. To explain my question, let me first give a brief background of it. The general structure for a two Process Solution for ...
0
votes
1answer
31 views

Is OS mode required for accessing general purpose registers

In which of the following cases a process executing in user model is required to enter into the OS mode? (a) Decreasing the value of unsigned integer value in a register to less than 0 (b) Accessing ...
1
vote
0answers
50 views

Deadlock vs “Progress” requirement of the solution to the critical section problem

I came across following problem: Consider following code: ...
1
vote
0answers
45 views

Peterson's Algorithm | Context switch after turn=process

Suppose we have two processes P0 and P1 using Peterson's Algorithm to access a critical section. Process P0 starts executing and sets its interested to TRUE and turn is set to 0. A context switch ...
3
votes
2answers
370 views

What is the problem with this Busy Wait solution for two threads?

We have two processes. One process produces F and the other process consumes F Initialization: Consuming = false Produced = false F = EMPTY The first thread (...
1
vote
0answers
47 views

Is a single starved process considered deadlocked?

In regard to the critical section problem, an algorithm that switches between allowing one of two processes, P1 or P2, to complete their critical section would cause starvation for P1 if P2 stayed in ...
6
votes
1answer
474 views

Bounded waiting and starvation free in critical section problem

i have 4 question regarding relation between starvation and bounded waiting. 1.Does starvation-freedom imply deadlock-freedom? My Answer-: From here, definition of starvation free is Freedom ...
2
votes
2answers
666 views

Increment and Decrement on binary semaphores when their values are $1$ and $0$ respectively?

What happens if we increment binary semaphore $x$ when it is equal to $1$. E.g A process executes $V(x)$ when $x==1$; What are the possible cases then- Process would be blocked till $x$ becomes $0$. ...
5
votes
1answer
5k views

Understanding N process Peterson's algorithm

The intuitive informal description of two process Peterson's algorithm for process 0 can be given as follows: ...
1
vote
1answer
3k views

Bounded waiting and progress requirements of critical section problem solution based on exchange instruction

Atomic exchange instruction is given as follows: void exchange (int *a, int *b) { int temp; temp = *b; *b = *a; *a = temp; } Now consider the ...