• 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

Threads spawned byJVM

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
main thread is not a demon thread,but what about other threads that run in the background.
eg the ReferenceHandler thread,the Signal dispatcher thread etc.... as the JVM is said to start four threads for an application in the absence of a GUI.
I had posted this question earlier but did not get any answer,
can some one help me with this.
Vijay Pillai
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did not quite get your question ? Is the question about number of deamon threads started by JVM ?or doubt about whether main thread is deamon thread or not!!!
REgds
Shrinivas
 
Shrini Kulkarni
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
vijay,
If your doubt is about threads running in background. yes In my view all deamon threads run in background !!
but what is this background ?? something similar to low priority ?
Shrinivas
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vijay,
I also have similar doubt. See, when I store the activeCount in an Integer and display in S.o.p. I am getting more 2 than I expected i.e. threads I created + main + two. Suppose if there are four thread objects I am getting 7 as activeCount. The rest two threads meant for what? Are they threads what you are mentioning i.e. ReferenceHandler, Signal dispatcher, etc. I don't know. Let us hope that somebody will clarify our doubts.
Regards,
 
Vijay pillai
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
V Srinivasan,
Actually in the absense of a GUI, the JVM starts four threads
which are,
main,Finalizer,reference handler,signal dispatcher.
and with the GUI it starts fopur more threads which are,
AWT-WINDOWS,AWT-Event Queue-0,Sun Toolkit PostEvent Queue-0,
and the ScreenUpdater.
now out of this main is not a deamon thread not aabout the rest of them,I have no idea may be some one can explain better.
Vijay Pillai
 
Shrini Kulkarni
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
JVM starts totally 6 threads in absence of AWT,
They are :
main,signal dispatcher, reference handler,finaliser and 2 threads for JIT compilations. (I am not very clear about what JIT threads do )
For further reading follow this link.
http://www.jguru.com/jguru/faq/view.jsp?EID=141878
Regards
Shrinivas
 
V Srinivasan
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vijay,
Now I understand. JVM gives only one thread to run the program that is main, and all other created thread objects are contending for obtaining the main threads status i.e. main thread, obtains and runs. But the activeCount result is confusing. Probably the detailed part of thread Sun covers in Developers' Exam, is it. Let us hope somebody explains .
Regards
 
reply
    Bookmark Topic Watch Topic
  • New Topic