Skip to main content
2 votes

How are semaphores and test-and-set instructions connected?

Semaphores are an abstract mechanism to control access to a shared resource. Other such mechanisms exist, for example locks and monitors. These are the counterparts of abstract data structures – they ...
Yuval Filmus's user avatar
1 vote

What will you do if multiple users access your application at the same time?

my answer to the first problem would go like this: From a logical perspective, it depends on the actual purpose of the application, however, we should at least ensure safety and liveness, therefore ...
Chaos's user avatar
  • 543
1 vote

How to trigger a thread to start working using semaphore?

When using semaphores or locks, you don't do anything else than acquiring the semaphore (resp. the lock), and then do what you want. For example, if you want to use a lock, then you typically have ...
Pål GD's user avatar
  • 16.7k
1 vote

When does a semaphore issue a wait and when does it issue a signal?

The semaphore doesn't issue those. A semaphore is an object that can be used by processes to coordinate between themselves. Thus, a process will call semSignal or semWait on a shared semaphore. We ...
D.W.'s user avatar
  • 162k
1 vote

Designing solution to critical section problem with two semaphores vs single semaphore

If only one semaphore is used to control the access to the critical section, it is not possible for deadlock to happen. That is why two semaphores are used in the problem statement since the problem ...
John L.'s user avatar
  • 39.1k

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