System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 168
Q3701:
Thread pools are advantageous because they
A. are easy to use
B. require more memory
C. are complex to manage
D. are slow
Correct Answer:
A
Chapter: 168
Q3702:
Instead of creating a thread directly, an application creates a ________ for thread pools.
A. work object
B. thread object
C. callback function
D. handle
Correct Answer:
A
Chapter: 168
Q3703:
What does each work object in a thread pool have?
A. An ID number
B. A handle-like structure
C. A priority level
D. An error code
Correct Answer:
B
Chapter: 168
Q3704:
Thread pools manage a small number of ________.
A. worker threads
B. processes
C. memory blocks
D. handles
Correct Answer:
A
Chapter: 168
Q3705:
Who assigns worker threads to each work object in Windows?
A. CPU
B. Windows scheduler
C. Windows
D. Kernel
Correct Answer:
B
Chapter: 168
Q3706:
What does a worker thread do when executing a work object?
A. Invokes a callback function
B. Starts a new thread
C. Terminates the process
D. Releases the semaphore
Correct Answer:
A
Chapter: 168
Q3707:
When a worker object finishes execution, the worker thread
A. terminates
B. creates a new thread
C. returns to Windows thread pool
D. invokes another work object
Correct Answer:
D
Chapter: 168
Q3708:
Within the callback function, a work object should never invoke
A. _endthreadex()
B. _exit()
C. _sleep()
D. _yield()
Correct Answer:
A
Chapter: 168
Q3709:
Windows adjusts the number of worker threads ________ based on process behavior.
A. manually
B. dynamically
C. statically
D. periodically
Correct Answer:
B
Chapter: 168
Q3710:
Applications can set ________ for the number of worker threads in thread pools.
A. CPU affinity
B. priority
C. upper and lower bounds
D. process limits
Correct Answer:
C
Chapter: 168
Q3711:
There is always ________ thread pool available by default.
A. one
B. multiple
C. none
D. unlimited
Correct Answer:
A
Chapter: 168
Q3712:
Additional thread pools can be created by
A. Windows
B. Applications
C. the CPU
D. Schedulers
Correct Answer:
B
Chapter: 168
Q3713:
Thread pools improve performance by
A. reducing thread creation overhead
B. increasing CPU usage
C. delaying thread execution
D. avoiding synchronization
Correct Answer:
A
Chapter: 168
Q3714:
A thread pool worker object is identified by
A. a handle
B. callback function
C. name
D. priority
Correct Answer:
A
Chapter: 168
Q3715:
Using thread pools helps avoid frequent
A. thread creation
B. context switching
C. cache misses
D. memory leaks
Correct Answer:
A
Chapter: 168
Q3716:
The callback function in a thread pool is called by
A. worker thread
B. application
C. main thread
D. process
Correct Answer:
B
Chapter: 168
Q3717:
If a work object calls _endthreadex() inside the callback, it may cause
A. thread leaks
B. thread pool malfunction
C. thread termination
D. thread starvation
Correct Answer:
B
Chapter: 168
Q3718:
Windows thread pool adjusts threads according to
A. process load
B. process priority
C. memory usage
D. thread count
Correct Answer:
A
Chapter: 168
Q3719:
Thread pools are best suited for
A. applications with many short tasks
B. applications with few threads
C. real-time systems
D. single-threaded apps
Correct Answer:
A
Chapter: 168
Q3720:
Which statement is true about thread pools?
A. They use a fixed number of threads
B. They create a new thread for every task
C. They reuse threads to handle work objects
D. They terminate threads after every task
Correct Answer:
C