Operating System Multiple Choice Questions on “Thread Pools”.
1. Thread pools are useful when ____________
a) when we need to limit the number of threads running in the application at the same time
b) when we need to limit the number of threads running in the application as a whole
c) when we need to arrange the ordering of threads
d) none of the mentioned
Answer: a
2. Instead of starting a new thread for every task to execute concurrently, the task can be passed to a ___________
a) process
b) thread pool
c) thread queue
d) none of the mentioned
Answer: b
3. Each connection arriving at multi threaded servers via network is generally ____________
a) is directly put into the blocking queue
b) is wrapped as a task and passed on to a thread pool
c) is kept in a normal queue and then sent to the blocking queue from where it is dequeued
d) none of the mentioned
Answer: b
4. What is the idea behind thread pools?
a) a number of threads are created at process startup and placed in a pool where they sit and wait for work
b) when a process begins, a pool of threads is chosen from the many existing and each thread is allotted equal amount of work
c) all threads in a pool distribute the task equally among themselves
d) none of the mentioned
Answer: a
Clarification: None.
5. If the thread pool contains no available thread ____________
a) the server runs a new process
b) the server goes to another thread pool
c) the server demands for a new pool creation
d) the server waits until one becomes free
Answer: d
Clarification: None.
6. Thread pools help in ____________
a) servicing multiple requests using one thread
b) servicing a single request using multiple threads from the pool
c) faster servicing of requests with an existing thread rather than waiting to create a new thread
d) none of the mentioned
Answer: c
Clarification: None.
7. Thread pools limit the number of threads that exist at any one point, hence ____________
a) not letting the system resources like CPU time and memory exhaust
b) helping a limited number of processes at a time
c) not serving all requests and ignoring many
d) none of the mentioned
Answer: a
Clarification: None.
8. The number of the threads in the pool can be decided on factors such as ____________
a) number of CPUs in the system
b) amount of physical memory
c) expected number of concurrent client requests
d) all of the mentioned
Answer: d