Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 151
Q3321:
In the event usage model, PulseEvent() in manual-reset mode releases _______ threads simultaneously.
A. all
B. one
C. none
D. two
Correct Answer: A
Chapter: 151
Q3322:
SetEvent() releases threads by _______ the event.
A. signaling
B. resetting
C. opening
D. closing
Correct Answer: A
Chapter: 151
Q3323:
In the auto-reset model, when no threads are waiting, the event remains _______.
A. signaled
B. non-signaled
C. reset
D. open
Correct Answer: A
Chapter: 151
Q3324:
PulseEvent() is best described as a door that _______ after a thread passes in auto-reset mode.
A. closes
B. opens
C. locks
D. waits
Correct Answer: A
Chapter: 151
Q3325:
The key difference between auto-reset and manual-reset events is whether the event _______ automatically.
A. closes
B. signals
C. opens
D. blocks
Correct Answer: A
Chapter: 151
Q3326:
Manual-reset events are useful when _______ threads need to be released simultaneously.
A. multiple
B. single
C. none
D. one
Correct Answer: A
Chapter: 151
Q3327:
The SetEvent() function in event usage models is used to _______ threads.
A. release
B. wait
C. block
D. close
Correct Answer: A
Chapter: 151
Q3328:
PulseEvent() differs from SetEvent() in that it _______ threads temporarily.
A. releases and then resets
B. only signals
C. blocks all
D. opens a door
Correct Answer: A
Chapter: 151
Q3329:
Auto-reset events are like a door that _______ after a single use.
A. shuts
B. remains open
C. locks
D. ignores
Correct Answer: A
Chapter: 151
Q3330:
Manual-reset events allow threads to pass through until _______ is called.
A. ResetEvent()
B. SetEvent()
C. PulseEvent()
D. OpenEvent()
Correct Answer: A
Chapter: 151
Q3331:
If multiple threads need to be released simultaneously, a _______ reset event is preferred.
A. manual
B. auto
C. semi
D. dual
Correct Answer: A
Chapter: 151
Q3332:
PulseEvent() in manual-reset events _______ the event after releasing waiting threads.
A. resets
B. signals
C. opens
D. locks
Correct Answer: A
Chapter: 152
Q3333:
What synchronization mechanism is used in the Producer-Consumer solution described?
A. Mutexes
B. Semaphores
C. Critical Sections
D. Spinlocks
Correct Answer: A
Chapter: 152
Q3334:
What kind of event is used to signal the availability of new messages in the Producer-Consumer solution?
A. Auto-reset event
B. Manual-reset event
C. Binary semaphore
D. Counting semaphore
Correct Answer: A
Chapter: 152
Q3335:
Which function in the code is responsible for filling the message buffer with data?
A. Produce
B. MessageFill
C. Consume
D. MessageDisplay
Correct Answer: B
Chapter: 152
Q3336:
What is the purpose of the mGuard in the MSG_BLOCK structure?
A. Signal event
B. Mutex to guard the message block
C. Store message data
D. Count lost messages
Correct Answer: B
Chapter: 152
Q3337:
Which flag indicates that a message is ready to be consumed?
A. fReady
B. fStop
C. mReady
D. mGuard
Correct Answer: A
Chapter: 152
Q3338:
In the Producer-Consumer solution, what happens after SetEvent(mBlock.mReady) is called?
A. The consumer thread is signaled to consume the message
B. The producer stops producing
C. The mutex is released
D. The checksum is validated
Correct Answer: A
Chapter: 152
Q3339:
The variable mSequence in MSG_BLOCK represents:
A. The number of messages lost
B. The message sequence number
C. The mutex handle
D. The event handle
Correct Answer: B
Chapter: 152
Q3340:
Sleep(rand()/5) in the producer thread is used to:
A. Control message generation rate
B. Lock the mutex
C. Signal consumer thread
D. Validate checksum
Correct Answer: A

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now