• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Java Multiple Threads-Multiprocessor

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
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
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.
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic