Bookmark Topic Watch Topic
  • New Topic

Dual processor utilization

 
Sudhanshu Umalkar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Report post to moderator
Is there a way to improve performance of the java module by utilizing the second processor on a dual processor machine?
To be precise, can I execute two threads and specify exclusively to each one of them which processor (CPU) they should utilize?
How a dual processor machine can be used efficiently to improve the performance of a java application?
 
Geoffrey Falk
Ranch Hand
Posts: 171
1
  • Mark post as helpful
  • send pies
  • Report post to moderator
What operating system are you using? Most modern operating systems (Unix, Linux, WinNT/2000 etc.) will automatically assign your threads to run on whatever processor is free at any given time. If you have a 2-threaded application, it will automatically take advantage of the 2 CPUs. There is no need to specify which processor the thread will run on.
In fact, the operating system performs "time slicing" which implies your thread may be executing on either processor, and may in fact switch between processors!
Geoffrey
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't cross-post. I'm closing this copy of this thread. Followups here.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic