Thanks for constructive criticism. I had the premise in mind and have faltered in the implementation. I have corrected the implementation and tested with your code.
It is starting now starting 10 threads only and as and when threads become available more tasks are being executed.
Starting execution with virtual thread: 26
Starting execution with virtual thread: 22
Starting execution with virtual thread: 20
Starting execution with virtual thread: 23
Starting execution with virtual thread: 28
Starting execution with virtual thread: 25
Starting execution with virtual thread: 27
Starting execution with virtual thread: 30
Starting execution with virtual thread: 32
Starting execution with virtual thread: 29
Finished executing with virtual thread: 22
Finished executing with virtual thread: 28
Finished executing with virtual thread: 30
Finished executing with virtual thread: 20
Starting execution with virtual thread: 33
Starting execution with virtual thread: 34
Starting execution with virtual thread: 35
Finished executing with virtual thread: 25
Finished executing with virtual thread: 26
Starting execution with virtual thread: 39
Finished executing with virtual thread: 32
Starting execution with virtual thread: 40
Finished executing with virtual thread: 29
Finished executing with virtual thread: 23
Finished executing with virtual thread: 27
Starting execution with virtual thread: 38
Starting execution with virtual thread: 37
Starting execution with virtual thread: 41
Starting execution with virtual thread: 42
Starting execution with virtual thread: 31
Finished executing with virtual thread: 33
Finished executing with virtual thread: 34
Finished executing with virtual thread: 35
Finished executing with virtual thread: 39
Finished executing with virtual thread: 40
Finished executing with virtual thread: 38
Finished executing with virtual thread: 37
Finished executing with virtual thread: 41
Finished executing with virtual thread: 31
Finished executing with virtual thread: 42