I have an application written in java I am creating a pool of threads and executing a process on each thread. If i create a single thread on single processor system and give the process on it, it is taking 30 sec. if i create two threads on dual processor system and giving the process on each thread, it is taking 54 sec. I want to know how the dual processor system works in case of multi threading. Thanks for the help.
posted 13 years ago
It might have to do with the platform and JVM you are using. I ran the following code on a 3 processor Sun, when only one thread is created I can only use 33.3% of the CPU, when 2 threads are created it starts to use 66.6% and when all 3 threads are started I use all available processors.