2 votes
Accepted

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 ...
1 vote
Accepted

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 ...
  • 169
1 vote
Accepted

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 ...
  • 13.4k
1 vote
Accepted

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 ...
  • 144k
1 vote
Accepted

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 ...
  • 35.3k

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