• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what are the Threads runs when a java program running?

 
jacob deiter
Ranch Hand
Posts: 580
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what are the Threads runs when a java program running?
 
Ankit Garg
Sheriff
Posts: 9496
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well when a program is running, there are threads that we create that are running. If your program is a simple console program, then there is a main thread which executed the main method and other threads that you create in the main thread. Also there are a few daemon threads run by the JVM. I know of one such thread i.e. the garbage collector but I'm sure there would many more like that...
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've put a code example called ThreadLister in the Code Barn. It enumerates all active threads. If you run that in a GUI app, or a web app, there will be quite a few more threads than if you run it from the command line.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic