• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Utilizing second processor

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • 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?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's no way to specify the "CPU affinity" of a thread; but if you create multiple threads on a multiprocessor machine, then a well-implemented JVM will schedule them efficiently on the available processors. I've had dual-CPU Xeons for years now, and find that under both Linux and Windows, multi-threaded CPU-bound programs see an appropriate speedup on multiprocessor machines.
 
Ranch Hand
Posts: 1170
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Improve java's performance to the detriment of which other program? This kind of thing is handled automatically by the operating system. If two CPUs are available and you have a program that can run concurrently, then the OS will likely make use of both CPUs. But you will not have exclusive or dedicated access.
reply
    Bookmark Topic Watch Topic
  • New Topic