GATE Exam  >  GATE Questions  >   A semaphore S is an integer variable that, a... Start Learning for Free
A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait () and signal (). Thus which of the following in regards to semaphore is false.
  • a)
    In does not require busy waiting
  • b)
    It is of two types binary and counting
  • c)
    In semaphore two processes cannot execute wait() and signal() at the same time.
  • d)
    In Semaphore variable integer value can range over an unrestricted domain
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
A semaphore S is an integer variable that, apart from initialization,...
Semaphore variable requires busy waiting, While a process is in its critical section, any other process that tries to enter its critical section must loop continuously in the entry code.
SOLUTION TO THE BUSY WAITING PROBLEM
To overcome the need for busy waiting, we can modify the definition of the wait () and signal () semaphore operations. When a process executes the wait () operation and finds that the semaphore value is not positive, it must wait. However, rather than engaging in busy waiting, the process can block itself. The block operation places a process into a waiting queue associated with the semaphore, and the state of the process is switched to the waiting state. Then control is transferred to the CPU scheduler, which selects another process to execute. A process that is blocked, waiting on a semaphore S, should be restarted when some other process executes a signal ( ) operation. The process is restarted by a wakeup () operation, which changes the process from the waiting state to the ready state.
View all questions of this test
Most Upvoted Answer
A semaphore S is an integer variable that, apart from initialization,...
Explanation:

Semaphore is a synchronization tool that is used to manage concurrent access to a shared resource in a multi-process or multi-threaded environment. The semaphore provides a mechanism to control the access to the shared resource by multiple processes or threads.

The given statement about the semaphore is as follows:

"A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait () and signal (). Thus which of the following in regards to semaphore is false."

Let's analyze each option to determine which one is false.

a) In does not require busy waiting

- This statement is false because the wait() operation in semaphore requires busy waiting, which means the process will continuously loop until the semaphore is available.

b) It is of two types binary and counting

- This statement is true. There are two types of semaphores: binary semaphore and counting semaphore. A binary semaphore has only two states: 0 and 1, whereas a counting semaphore can have any non-negative integer value.

c) In semaphore two processes cannot execute wait() and signal() at the same time.

- This statement is false. Multiple processes can execute wait() and signal() operations on the same semaphore simultaneously. However, the order of execution may not be deterministic.

d) In Semaphore variable integer value can range over an unrestricted domain

- This statement is true. The integer value of a counting semaphore can range over an unrestricted domain.

Conclusion:

The false statement regarding the semaphore is option 'A'. Semaphore does require busy waiting.
Explore Courses for GATE exam

Similar GATE Doubts

A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait () and signal (). Thus which of the following in regards to semaphore is false.a)In does not require busy waitingb)It is of two types binary and countingc)In semaphore two processes cannot execute wait() and signal() at the same time.d)In Semaphore variable integer value can range over an unrestricted domainCorrect answer is option 'A'. Can you explain this answer?
Question Description
A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait () and signal (). Thus which of the following in regards to semaphore is false.a)In does not require busy waitingb)It is of two types binary and countingc)In semaphore two processes cannot execute wait() and signal() at the same time.d)In Semaphore variable integer value can range over an unrestricted domainCorrect answer is option 'A'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait () and signal (). Thus which of the following in regards to semaphore is false.a)In does not require busy waitingb)It is of two types binary and countingc)In semaphore two processes cannot execute wait() and signal() at the same time.d)In Semaphore variable integer value can range over an unrestricted domainCorrect answer is option 'A'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait () and signal (). Thus which of the following in regards to semaphore is false.a)In does not require busy waitingb)It is of two types binary and countingc)In semaphore two processes cannot execute wait() and signal() at the same time.d)In Semaphore variable integer value can range over an unrestricted domainCorrect answer is option 'A'. Can you explain this answer?.
Solutions for A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait () and signal (). Thus which of the following in regards to semaphore is false.a)In does not require busy waitingb)It is of two types binary and countingc)In semaphore two processes cannot execute wait() and signal() at the same time.d)In Semaphore variable integer value can range over an unrestricted domainCorrect answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait () and signal (). Thus which of the following in regards to semaphore is false.a)In does not require busy waitingb)It is of two types binary and countingc)In semaphore two processes cannot execute wait() and signal() at the same time.d)In Semaphore variable integer value can range over an unrestricted domainCorrect answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait () and signal (). Thus which of the following in regards to semaphore is false.a)In does not require busy waitingb)It is of two types binary and countingc)In semaphore two processes cannot execute wait() and signal() at the same time.d)In Semaphore variable integer value can range over an unrestricted domainCorrect answer is option 'A'. Can you explain this answer?, a detailed solution for A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait () and signal (). Thus which of the following in regards to semaphore is false.a)In does not require busy waitingb)It is of two types binary and countingc)In semaphore two processes cannot execute wait() and signal() at the same time.d)In Semaphore variable integer value can range over an unrestricted domainCorrect answer is option 'A'. Can you explain this answer? has been provided alongside types of A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait () and signal (). Thus which of the following in regards to semaphore is false.a)In does not require busy waitingb)It is of two types binary and countingc)In semaphore two processes cannot execute wait() and signal() at the same time.d)In Semaphore variable integer value can range over an unrestricted domainCorrect answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait () and signal (). Thus which of the following in regards to semaphore is false.a)In does not require busy waitingb)It is of two types binary and countingc)In semaphore two processes cannot execute wait() and signal() at the same time.d)In Semaphore variable integer value can range over an unrestricted domainCorrect answer is option 'A'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev