Limited Number of threads.
i have created a loop which is running from 1 - 10000.
i that loop i am creating new thread and starting it. i don't what my program to run thousands of thread at a time . i want only 10 threads to run at a time, and new threads should be created only when one of the 10 thread completes.
Please tell me how to achieve this.

