Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Different threads using different core of processor  RSS feed

 
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
Saloon Keeper
Posts: 3889
91
  • 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
Saloon Keeper
Posts: 3889
91
  • 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
Posts: 21092
85
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
Boost this thread!