wrote:
I need to use threads such that 2 threads(of 12) run at a time, asynchronously. The 12 threads are to run in a sequential manner, 2 at a time.
That is a terrible idea and never go for it. I'd suggest you to use a
ThreadPool
and forget about managing how many threads executes at a time.
ThreadPool
queues up the work requests and process them with optimum resources.