Adi s
Adi s

Reputation: 31

Contention for semaphore by two processes executing down_interruptible call simultaeously

Is it possible that a semaphore with an initial value of 1 be acquired simultaneously by two processes which are running on different processor cores via the down_interruptible call.

Upvotes: 0

Views: 195

Answers (1)

Tsyvarev
Tsyvarev

Reputation: 66089

No, it is not possible for 1-initialized semaphore to be acquired simultaneously by different processes.

Semaphores, like other synchronisation mechanisms, are intended to use by different processes/threads. Why do you think that accesses from different processors can break them?

Upvotes: 1

Related Questions