Results 1 to 3 of 3
- 12-09-2011, 04:03 AM #1
Member
- Join Date
- Nov 2011
- Posts
- 4
- Rep Power
- 0
One process open multiple threads on multiple CPUs
I am using the code below to open up multiple threads (20+).
However, it seems that all the threads are running on 1 CPU when I do have 4 cores(according to task manager).
I am guessing there is a limitation on where my threads can be run.
In other word, threads can only be open up on the CPU where the original process started.
Obviously something have gone wrong some where.
Anybody got some suggestions?
Thanks a lot in advance :)
Additional information on platform:
I am using Eclipse to code.
Have tried to run on both windows 7 and XP, none works.
Runnable runnable = new XThread();
Thread thread = new Thread(runnable);
thread.start();
public class XThread implements Runnable
{
public void run()
{
}
}Last edited by kfcnhl; 12-09-2011 at 04:10 AM.
- 12-09-2011, 10:35 PM #2
Re: One process open multiple threads on multiple CPUs
It could be that your particular JVM is using lightweight threads instead of OS-level threads. See if there's a JVM option to change it, try a different JVM, or switch to Linux.
Get in the habit of using standard Java naming conventions!
- 12-12-2011, 08:27 AM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,606
- Blog Entries
- 7
- Rep Power
- 17
Re: One process open multiple threads on multiple CPUs
When people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
synchronization issue with multiple threads
By harmeet in forum Threads and SynchronizationReplies: 0Last Post: 05-01-2011, 04:01 AM -
Running multiple threads on multiple CPU cores?
By Dosta in forum Threads and SynchronizationReplies: 2Last Post: 09-19-2010, 03:48 PM -
One socket and multiple threads
By DC200 in forum NetworkingReplies: 1Last Post: 12-30-2009, 06:32 AM -
Multiple Process Creation in EJB3.0
By sankarguru in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 03-25-2009, 05:26 AM -
multiple threads access the same method.
By bhanu in forum New To JavaReplies: 3Last Post: 02-16-2009, 06:54 AM


2Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks