Total members 10260 | Gratitudes |It is currently Mon May 21, 2012 4:45 pm Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 4 posts ] 
Author Topic
 Topic subject: daemon thread - What is the use of deamon thread?
PostPosted: Fri Oct 17, 2008 1:24 pm 
Offline
Beginner
User avatar

Joined: Sun May 25, 2008 5:34 pm
Posts: 95
Has thanked: 2 time
Have thanks: 1 time

Daemon term is mainly used in UNIX. In Java, this is used to indicate a special type of thread. Normally when a thread is created in Java, by default it is a non-daemon thread. Whenever a Java Program is executed, the Java Virtual Machine (JVM) will not exit until any non-daemon threads are still running. This means if the main thread of an application ends and the remaining threads left are Daemon threads, then the JVM will exit killing all the daemon threads without warning.
A daemon thread should be used for some background task that might provide a service to the applications. e.g. a Server thread listening on a port for the clients` requests. A thread for which an exit method is not provided or which does not have an exit mechanism can be marked as a daemon thread.


TOP
 Profile Send private message  
Reply with quote  
 Topic subject: Re: daemon thread - What is the use of deamon thread?
PostPosted: Tue Aug 11, 2009 12:01 am 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2277
Location: Earth
Has thanked: 39 time
Have thanks: 61 time
thank you for this information . :)

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
 Topic subject: Re: daemon thread - What is the use of deamon thread?
PostPosted: Tue Aug 11, 2009 5:17 am 
Offline
Newbie
User avatar

Joined: Mon Jul 27, 2009 7:14 am
Posts: 13
Has thanked: 0 time
Have thanks: 0 time
Daemon term is mainly used in UNIX. In Java, this is used to indicate a special type of thread. Normally when a thread is created in Java, by default it is a non-daemon thread. Whenever a Java Program is executed, the Java Virtual Machine (JVM) will not exit until any non-daemon threads are still running. This means if the main thread of an application ends and the remaining threads left are Daemon threads, then the JVM will exit killing all the daemon threads without warning.


TOP
 Profile Send private message  
Reply with quote  
 Topic subject: Re: daemon thread - What is the use of deamon thread?
PostPosted: Tue Aug 11, 2009 8:32 am 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2277
Location: Earth
Has thanked: 39 time
Have thanks: 61 time
thank you this is a good addaition .

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 4 posts ] 
Quick reply


  


 Similar topics
 Plz Help,I want BOTH THREAD to work at a time in SAME WINDOW
 Multi Thread Program
 Thread of Event Dispatcher
 thread cannot acquire a lock on an object
 high-level thread states
 initial state of thread
 thread state when it terminates its processing
 Thread Safe

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 2 guests



Jump to:  
Previous Topic | Next Topic 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team