System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q2731: SwitchToThread() causes the current thread to yield the processor to another thread that is ________.
- A: ready to run
- B: terminated
- C: sleeping
- D: suspended
View Answer
A
Q2732: Sleep can be used to perform a task ________ by putting the thread to sleep after each task.
- A: periodically
- B: randomly
- C: sequentially
- D: indefinitely
View Answer
A
Q2733: When Sleep(0) is called, the thread moves from running to the ________ state immediately.
- A: ready
- B: waiting
- C: suspended
- D: terminated
View Answer
A
Q2734: SwitchToThread() allows the thread to ________.
- A: yield its processor
- B: terminate
- C: suspend
- D: increase priority
View Answer
A
Q2735: The Sleep function belongs to which of the following programming languages or APIs?
- A: Windows API
- B: Java
- C: Python
- D: Linux Kernel
View Answer
A
Q2736: Sleep duration must be passed as a ________ value.
- A: DWORD
- B: string
- C: float
- D: boolean
View Answer
A
Q2737: If a thread is sleeping with Sleep(INFINITE), it will ________.
- A: never resume
- B: resume after 1 hour
- C: resume immediately
- D: resume after 1 second
View Answer
A
Q2738: The function SwitchToThread() is used to ________.
- A: voluntarily yield processor
- B: forcibly stop the thread
- C: start a new thread
- D: increase thread priority
View Answer
A
Q2739: Using Sleep to pause thread execution can help avoid ________ in a multithreaded program.
- A: CPU hogging
- B: data race
- C: deadlock
- D: synchronization issues
View Answer
A
Q2740: Sleep with a 0 value effectively allows other threads of the same ________ to run.
- A: priority
- B: state
- C: ID
- D: process
View Answer
A