This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • 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: 2730
36
  • 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: 2730
36
  • 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: 20510
54
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