4 votes

Whats exact definition of 'atomicity' in programming?

If an operation X is atomic, that means that anyone observing the operation will see it either as not yet started, or as completed, and not in any state that is partially completed. That's it. ...
user avatar
  • 25.4k
4 votes
Accepted

Bounded waiting and starvation free in critical section problem

No, starvation-free doesn't imply bounded waiting. For instance, consider a procedure that never even attempts to acquire any lock; but the amount of time it takes is variable and can be arbitrarily ...
user avatar
  • 143k
4 votes

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

A binary semaphore has the wait() and the signal() method. The one which causes a process to stop is the wait() method, while the one that increments the counter x in the semaphore is signal(). If ...
user avatar
  • 581
2 votes

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

Your approach works fine providing assignment operations are atomic. But I cannot see any concurrency in your approach. $P_2$ always waits until $P_1$ produces and reaches the upper limit, for example ...
user avatar
  • 9,632
2 votes

Understanding N process Peterson's algorithm

The way the N-process Peterson's algorithm works is slightly different than how the 2-process version is presented above. We can reason about the N-process version a little more like this: When a ...
user avatar
  • 1,944
2 votes

Whats exact definition of 'atomicity' in programming?

I'm not sure I know of a simple, formal, abstract definition of "atomic" for a programming language. I know of many different ones at various levels of abstraction and with regards to various topics. ...
user avatar
1 vote
Accepted

Thread - contention vs race

These are two distinct phenomena. Contention refers to the fact that when thread $A$ has accessed a resource $B$ needs to wait until $A$ frees it. Race refers to the fact when both threads $A$ and $...
user avatar
1 vote

Does Dekkers solutions to critical section problem ensure progress?

The overall structure of the processes is modelled to be like: ...
user avatar
  • 13.7k
1 vote
Accepted

Is OS mode required for accessing general purpose registers

Computations on general-purpose registers ((a), (b), (d)) doesn't require any privileges. Input/output requires privileges, to access a peripheral or to communicate with the part of the system that ...
user avatar
1 vote

Understanding N process Peterson's algorithm

I'm late to the party but I suppose I can offer my intuition on this. I think of it as a race between threads. The race consists the number of laps = #threads-1. The idea is after each lap, 1 thread ...
user avatar
1 vote

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

Little late anyway...First of all 8 do exchange (&key, &lock) 9 while (key != 0); //if lock wasn’t free The exchange instruction has to ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible