• 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

Can I know and regulate the thread-mode of JVM?

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can i know the JVM use green thread or native thread?
Can i regulate the JVM to use a specific thread-mode?
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is implementation specific. Some VMs are constrained to a specific type, others do both (Linux and SCO for instance.) Check the implementation documentation for the command line arguments to switch. You will not, I don't think, have a standard way to access this from within the JVM, though a VM may provide read-only access to it via System.properties().
 
Li Shangqiang
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have know that if the VM use green thread, then the application in Java can't benefit from Multi-CPU, but if the VM use native thread, then the application can make use of Multi-CPU. But, I'm very confused that i can't know anything from the VM that if it is using native thread mode. Can Yuri Gadow or other give me a more clear answer?
 
Yuri Gadow
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The point is just that you will have to look in the documentation for the specific VM implementation you are using to find out which is used. Most current VM's use native threads, but some provide both if the native implementation is considered flaky. I've never payed any attention to green threads, so I couldn't say if threads can be scheduled across CPU's in "green mode" or not. But it would certainly make sense if that were the case.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic