Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 152
Q3381:
The producer thread releases the mutex by calling:
A. ReleaseMutex
B. WaitForSingleObject
C. CloseHandle
D. SetEvent
Correct Answer: A
Chapter: 152
Q3382:
The message block mutex and event are created in the:
A. Main function
B. Produce function
C. Consume function
D. MessageFill function
Correct Answer: A
Chapter: 152
Q3383:
What does the Sleep function call simulate in the producer thread?
A. Random delay between message generation
B. Waiting for consumer thread
C. Checksum calculation
D. Message display
Correct Answer: A
Chapter: 152
Q3384:
The consumer thread uses _tscanf_s to:
A. Get user commands
B. Read message data
C. Generate checksum
D. Signal event
Correct Answer: A
Chapter: 152
Q3385:
The variable fReady is set to 0 after:
A. Message consumption
B. Message generation
C. Mutex release
D. Event signaling
Correct Answer: A
Chapter: 152
Q3386:
The function _leave is used to:
A. Exit the current thread
B. Elevate thread priority
C. Wait for event
D. Reset message flags
Correct Answer: A
Chapter: 152
Q3387:
What is the data size defined by DATA_SIZE macro?
A. 256
B. 128
C. 512
D. 1024
Correct Answer: A
Chapter: 152
Q3388:
The producer thread stops producing messages when:
A. fStop flag is set
B. mReady is set
C. mGuard is released
D. nCons equals mSequence
Correct Answer: A
Chapter: 152
Q3389:
Which of the following is TRUE about auto-reset events?
A. They automatically reset after releasing a single thread
B. They require manual reset
C. They can release multiple threads simultaneously
D. They do not signal threads
Correct Answer: A
Chapter: 152
Q3390:
What does the variable mTimestamp hold?
A. Time message was created
B. Checksum value
C. Message sequence number
D. Mutex handle
Correct Answer: A
Chapter: 152
Q3391:
What happens if WaitForSingleObject(mBlock.mGuard, INFINITE) is called in the producer thread?
A. Mutex is locked until released
B. Mutex is created
C. Event is set
D. Thread is suspended
Correct Answer: A
Chapter: 152
Q3392:
What happens when the producer sets fReady to 1?
A. Message is marked ready to consume
B. Mutex is released
C. Event is signaled
D. Checksum is calculated
Correct Answer: A
Chapter: 152
Q3393:
The MSG_BLOCK's mData array stores:
A. Message contents
B. Mutex handles
C. Event handles
D. Thread IDs
Correct Answer: A
Chapter: 153
Q3394:
Windows operating system kernel supports ________ to improve program design and performance.
A. Multiprocessing
B. Multithreading
C. Single-threading
D. None of the above
Correct Answer: B
Chapter: 153
Q3395:
Process synchronization is used to coordinate processes that use ________.
A. Separate data
B. Shared data
C. Independent memory
D. Different threads
Correct Answer: B
Chapter: 153
Q3396:
Which synchronization object is NOT listed as used for synchronizing access to resources in Windows?
A. Critical Section
B. Semaphore
C. Barrier
D. Event
Correct Answer: D
Chapter: 153
Q3397:
A ________ is a synchronization object that allows only one thread to access a resource at a time.
A. Mutex
B. Event
C. Critical Section
D. Semaphore
Correct Answer: A
Chapter: 153
Q3398:
Which synchronization object is typically used to signal one or more waiting threads that an event has occurred?
A. Event
B. Mutex
C. Critical Section
D. Semaphore
Correct Answer: A
Chapter: 153
Q3399:
To coordinate access to shared data in a multithreaded program, one would use ________.
A. Critical Section
B. Event
C. Mutex
D. All of the above
Correct Answer: D
Chapter: 153
Q3400:
The Windows OS supports synchronization objects to manage ________ in real-time applications.
A. Thread creation
B. Thread suspension
C. Thread coordination
D. Thread termination
Correct Answer: C

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now