• 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

JVM threads

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JVM is supposed to use threads internally when any application is being executed. How do I know the list of all threads that JVM/OS is managing?
For example: I write a "Hello World" program. How do I find out what are the internal threads that JVM manages to execute the above program?
Please help me understand the multithreading concepts.
Thanks in advance,
Manasa
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, there's always the main thread, which executes your application. There's a separate one for the garbage collector. If you run a GUI application, there's another handling events. Of course, there will also be any threads you started. Any decent debugger should show you what threads exists. Profilers, like OptomizeIt, can also display this information.
There are probably more low-tech, manual ways to get this information as well. (After all the debuggers and profilers must be getting it from somewhere.) The Thread class has an enumrate() method, which will show you all threads in the same ThreadGroup. You might also make a study of the -X options to the JVM. One of them might make thread information accessible. I prefer to rely on tools though.
 
Manasa Rao
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much. That was very informational.
Manasa
 
reply
    Bookmark Topic Watch Topic
  • New Topic