System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q3241: When a thread waits on a semaphore, the count is _______ once the thread is released.
- A: incremented
- B: decremented
- C: maintained
- D: reset
View Answer
B
Q3242: The semaphore count must always satisfy the condition _______.
- A: 0 <= count <= maximum
- B: count >= 0
- C: count < 0
- D: count > maximum
View Answer
A
Q3243: A semaphore's signaled state means it can _______.
- A: allow a waiting thread to proceed
- B: block other threads
- C: wait for signal
- D: stop execution
View Answer
A
Q3244: The ReleaseSemaphore function increases the count by the value of _______.
- A: cReleaseCount
- B: lpPreviousCount
- C: 1
- D: 0
View Answer
A
Q3245: Which parameter in CreateSemaphore() sets the maximum allowed count?
- A: lSemMax
- B: lSemInitial
- C: lpSemName
- D: lpsa
View Answer
A
Q3246: If ReleaseSemaphore() fails, the semaphore count will _______.
- A: change
- B: remain unchanged
- C: double
- D: zero out
View Answer
B
Q3247: The initial semaphore count represents the number of _______.
- A: allowed waiting threads
- B: available resources
- C: maximum locks
- D: maximum threads
View Answer
B
Q3248: A semaphore count represents the number of _______.
- A: available threads
- B: available resources
- C: maximum threads
- D: locked resources
View Answer
B
Q3249: In a producer-consumer scenario, the producer calls _______ after placing an element in the queue.
- A: WaitSemaphore()
- B: ReleaseSemaphore()
- C: CreateSemaphore()
- D: OpenSemaphore()
View Answer
B
Q3250: The consumer in a producer-consumer scenario _______ on the semaphore before consuming an item.
- A: releases
- B: waits
- C: creates
- D: opens
View Answer
B