Hi Rahul,
What this code will prove? I think something wrong in this program.
For one case you are just instantiating
Thread object
In another case you are just calling run() method directly(without thread).
What we can conclude these two results one is time taken to create 100000 Thread objects( please remember invoking start method only causes creation of new thread)
and another is time taken to execute thread body without Threads.
Please check the program.
Here I'm posting your program with modifications. Please check these corrections are valid or not
It gives the comparative time results to execute a thread body with threads and without threads.
In my opinion this is not the bench mark to decide maximum number of threads. Just a guideline. This will vary with application. For tuning properly a multithreaded system, we need to
test time calcultation using this type of opproach to minimize time per thread.
Thank you,
-SaTyA-
Hi,
Please use [ code] [ /code] tags to format your code. Thanks. [This message has been edited by Rahul Mahindrakar (edited January 29, 2001).]