Solutionunvalidated

use a set to define which are currently running, and remove from set at end rather than before calling `process(client)` — You could use a counter (AtomicInteger) instead of `HashSet`, or `Semaphore`. Tension: your locks don't prevent more than MAX_THREAD_POOL running threads at once. Outcome: which is intended for this type of use.

52687d0d-190b-42f1-abea-d1179db22a5c

use a set to define which are currently running, and remove from set at end rather than before calling process(client) — You could use a counter (AtomicInteger) instead of HashSet, or Semaphore. Tension: your locks don't prevent more than MAX_THREAD_POOL running threads at once. Outcome: which is intended for this type of use.