Author
Different threads using different core of processor
Madhumitha Baskaran
Ranch Hand
Joined: Feb 27, 2010
Posts: 62
Hi,
I have a doubt using threads. If I create a multithreaded program, will it be possible for me to let every thread to use one core separately and work simultaneously?
Please guide.
Thanks,
Madhu
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2407
posted Nov 22, 2011 02:02:44
2
That's up to the JVM and OS; your code can't influence that.
Madhumitha Baskaran
Ranch Hand
Joined: Feb 27, 2010
Posts: 62
I am trying to implement Mapreduce. How could I make sure that performance is best by using threads?
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2407
posted Nov 22, 2011 02:36:46
0
The best way is probably to use an existing Mapreduce implementation that is tuned for concurrency already. That is not an easy thing to get right.
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
Java 7 has added the Fork/Join framework which should utilize the processes as efficiently as possible.
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
subject: Different threads using different core of processor