System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q3091: The producer generates a new message block only if _____.
- A: fStop is set
- B: fReady is 1
- C: fReady is 0
- D: mChecksum is valid
View Answer
C
Q3092: Which function is used to seed the random number generator in the Producer thread?
- A: randomize()
- B: srand()
- C: rand()
- D: time()
View Answer
B
Q3093: The data array size in MSG_BLOCK is
- A: 128
- B: 64
- C: 512
- D: 256
View Answer
D
Q3094: The message is filled with random values in the function
- A: Produce()
- B: Consume()
- C: MessageDisplay()
- D: MessageFill()
View Answer
D
Q3095: Which Windows API function is used to wait for thread termination?
- A: WaitForProcess()
- B: WaitForThread()
- C: WaitForSingleObject()
- D: Sleep()
View Answer
C
Q3096: What happens if the checksum does not match in MessageDisplay()?
- A: Error message is printed
- B: Program exits
- C: Message is ignored
- D: It is reprocessed
View Answer
A
Q3097: The Producer and Consumer threads share the same
- A: Mutex only
- B: Data only
- C: Message block
- D: MessageDisplay function
View Answer
C
Q3098: Each message block contains a timestamp to indicate
- A: When it was validated
- B: When it was received
- C: When it was produced
- D: When it was stopped
View Answer
C
Q3099: The correct function to increment `mSequence` atomically is
- A: Increment()
- B: AtomicAdd()
- C: InterlockedIncrement()
- D: ThreadSafeInc()
View Answer
C
Q3100: The Consumer prompts the user for action using which command?
- A: s and r
- B: c and s
- C: p and c
- D: q and t
View Answer
B