aspose file tools*
The moose likes Threads and Synchronization and the fly likes utilize the CPU to the fullest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "utilize the CPU to the fullest" Watch "utilize the CPU to the fullest" New topic
Author

utilize the CPU to the fullest

ankur jainmrec
Greenhorn

Joined: Oct 28, 2003
Posts: 4
If a thread is used, even a 12 CPU machine will effectively a single CPU machine, as all the threads of a process run on the same CPU. How do I make a Java process utilize the CPU to the fullest? Can I do some system programming like C language?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

How threads map onto processors is operating-system and JVM-implementation dependent, but on Intel architectures (both Linux and Windows machines) threads are distributed across all processors -- so your basic thesis is incorrect. If you've got an OS/JVM combination that behaves the way you suggest, then you should look into running on a better platform.


[Jess in Action][AskingGoodQuestions]
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Is there any OS where Java doe not make use of multiple processors.
[ November 07, 2003: Message edited by: Pradeep Bhat ]

Groovy
ankur jainmrec
Greenhorn

Joined: Oct 28, 2003
Posts: 4
thank you for the answer
and sorry for the cross posting in test forum, i did it mistakenly
 
 
subject: utilize the CPU to the fullest