• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Different threads using different core of processor

 
Madhumitha Baskaran
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2946
46
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's up to the JVM and OS; your code can't influence that.
 
Madhumitha Baskaran
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to implement Mapreduce. How could I make sure that performance is best by using threads?
 
Tim Moores
Bartender
Posts: 2946
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20661
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java 7 has added the Fork/Join framework which should utilize the processes as efficiently as possible.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic