Topic subject: daemon thread - What is the use of deamon thread?
Posted: Fri Oct 17, 2008 1:24 pm
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.
msi_333
Topic subject: Re: daemon thread - What is the use of deamon thread?
Posted: Tue Aug 11, 2009 12:01 am
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 )
Jayne Carreen
Topic subject: Re: daemon thread - What is the use of deamon thread?
Posted: Tue Aug 11, 2009 5:17 am
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.
msi_333
Topic subject: Re: daemon thread - What is the use of deamon thread?
Posted: Tue Aug 11, 2009 8:32 am
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 )