System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 126
Q2721:
Using too many threads may cause excessive ________ consumption.
A. virtual memory
B. CPU usage
C. disk space
D. network bandwidth
Correct Answer:
A
Chapter: 126
Q2722:
Excessive thread context switching can lead to increased ________.
A. performance overhead
B. memory usage
C. disk I/O
D. network delay
Correct Answer:
A
Chapter: 126
Q2723:
Correct multithreaded programs tend to be the most ________ in design.
A. simple and elegant
B. complex
C. resource-heavy
D. large
Correct Answer:
A
Chapter: 126
Q2724:
The lack of attention to basic threading principles can result in ________.
A. serious defects
B. improved performance
C. easier debugging
D. faster execution
Correct Answer:
A
Chapter: 126
Q2725:
Make no assumptions about the order in which the ________ and child threads execute.
A. parent
B. sibling
C. scheduler
D. process
Correct Answer:
A
Chapter: 127
Q2726:
The Sleep function moves a thread from the running state to the ________ state for a specified time.
A. wait
B. ready
C. suspended
D. terminated
Correct Answer:
A
Chapter: 127
Q2727:
After the Sleep time completes, the thread moves to the ________ state.
A. ready
B. running
C. waiting
D. terminated
Correct Answer:
A
Chapter: 127
Q2728:
Sleep time is specified in ________.
A. milliseconds
B. seconds
C. microseconds
D. nanoseconds
Correct Answer:
A
Chapter: 127
Q2729:
If Sleep is called with a value of 0, the thread relinquishes the remainder of its ________.
A. time slice
B. CPU memory
C. stack size
D. priority
Correct Answer:
A
Chapter: 127
Q2730:
The Sleep function's time value can be set to ________, which causes the thread to never resume.
A. INFINITE
B. ZERO
C. MAX_VALUE
D. MIN_VALUE
Correct Answer:
A
Chapter: 127
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
Correct Answer:
A
Chapter: 127
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
Correct Answer:
A
Chapter: 127
Q2733:
When Sleep(0) is called, the thread moves from running to the ________ state immediately.
A. ready
B. waiting
C. suspended
D. terminated
Correct Answer:
A
Chapter: 127
Q2734:
SwitchToThread() allows the thread to ________.
A. yield its processor
B. terminate
C. suspend
D. increase priority
Correct Answer:
A
Chapter: 127
Q2735:
The Sleep function belongs to which of the following programming languages or APIs?
A. Windows API
B. Java
C. Python
D. Linux Kernel
Correct Answer:
A
Chapter: 127
Q2736:
Sleep duration must be passed as a ________ value.
A. DWORD
B. string
C. float
D. boolean
Correct Answer:
A
Chapter: 127
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
Correct Answer:
A
Chapter: 127
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
Correct Answer:
A
Chapter: 127
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
Correct Answer:
A
Chapter: 127
Q2740:
Sleep with a 0 value effectively allows other threads of the same ________ to run.
A. priority
B. state
C. ID
D. process
Correct Answer:
A