Short Asnwer
Your shcedulerTreadPool
will pick first 5 tasks and put other 5 tasks to queue. Then When one of the currently busy threads exit next task will be scheduled to this thread
In other words
Your schedulerTread pool
holds every second exactly 5 threads.Tasks are submitted to the pool via an internal queue, which holds extra tasks(for you everything above 5 tasks currently runing) whenever there are more active tasks than threads.
To asnwer your question
First 5 tasks are picked
Whenever threads finishes task new task from queue is assigned to it
Repeat until there are tasks in internal queue