Thread Pool Design

In a basic thread pool, worker threads pull tasks from a shared queue. What happens when the queue is empty?

A

The thread pool shuts down and must be restarted

B

The worker threads are destroyed and recreated when new tasks arrive

C

Workers busy-wait by continuously checking the queue in a spin loop

D

Workers block on a condition variable until a new task is submitted and signals them