2 posts in topic
Flat View  Flat View

Posted By:   dinesh_dinu
Posted On:   Friday, June 13, 2003 07:42 AM

what is mean by dameon thread. where we use?and why?

Re: yhread

Posted By:   Stijn_Fonck  
Posted On:   Monday, June 16, 2003 02:36 AM

A JVM will execute threads till there are no more non-daemon thread. When all non-daemon thread are stopped execution the JVM will end. So a daemon thread won't stop your JVM from stopping while a non-daemon thread will do so. Most of the time a daemon thread is used for kind of profiling your program, as your program runs it collects data, when the 'normal' program stops, your profiling thread won't stop your program from stopping!

Re: yhread

Posted By:   Nick_Maiorano  
Posted On:   Sunday, June 15, 2003 07:26 AM


A daemon thread is just a concept. A daemon thread is just like any other thread except that it is generally used in managing services that require clients to establish connections to servers (i.e. ftp servers, http servers, etc).

If, for example, you have a client that wishes to establish a connection with an ftp server, the server has a daemon thread that is always running and listening for new connections. When it gets a request for a connection, it may create a new thread and delegate the work. This frees the daemon thread to listen for new requests from other clients.

About | Sitemap | Contact