I have a Machine with Win 2000, it is a multiprocessor machine with 4 Intel processors in it. When I run a java program with 4 threads the threads JVM should utilize the available processors(Intel chips) but it is not happening so as of now(I doubt).... is there any clue to do so... By default the threads that created in the JVM are green threads, means all the threads created in a JVM are user threads and are not OS level native threads. So when I run a Java program with 4 threads in a multi-processor environment all the threads run in only one processor while all the other processor are not used by our java threads. I use the following Java version "java version "1.3.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0) Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cn130-20010502w (JIT enabled: jitc)). Is there any way to use all the available processor effectively means when I spawn 4 threads is there a possibility that the 4 threads use all the 4 available processors? Please let me know the possible ways of doing so and also give me some reference on this topic. Regards, Bala
1. was win2K installed with MPS on? 2. java threads are not greed threads by default, where did you get that info? They used to be long ago, but not anymore. 3. How do you know multiple threads are not being spawned and used by the os? If possible why not download a JVM from Sun? it wont hurt to have many jvms installed. if you want 1.3 then 1.3.1_09 is probably the best to get.
Isn't the O.S. the one that decides how to use muliple processors? I didn't think there was a way to control that without writing seriously ugly O.S. level code or driver level code to control the hardware. My understanding is that we tell the computer what we would LIKE to have happen, and the O.S. controls exactly how that will be implemented. So maybe SOMETIMES you'll get multiple processors running your threads, and sometimes you'll only get access to one. This is just an OPINION coming from a Microsoft background - in other words, Microsoft doesn't implement multi-processors very well, so I'd be surprised if you could control access to them at all.
-nothing important to say, but learnin' plenty-