What is daemon threads?

Showing Answers 1 - 11 of 11 Answers

Justin Jose

  • Oct 19th, 2005
 

Theards which are running on the background are called deamon threads.

  Was this answer useful?  Yes

charanvv

  • Oct 19th, 2005
 

daemon thread is a thread which doesn't give any chance to run other threads once it enters into the run state it doesn't give any chance to run other threads

  Was this answer useful?  Yes

Justin

  • Oct 20th, 2005
 

Daemon thread is a low priority thread which runs intermittently in the back ground doing the garbage collection operation for the java runtime system. setDaemon method is used to create a daemon thread.

A thread is an independent sequential path of execution within a program. The JVM distinguishes between User threads & daemon threads. When a standalone application is run then as long as any user threads are active the JVM cannot terminate, otherwise the JVM terminates along with any daemon threads which might be active. Thus a daemon thread is at the mercy of the runtime system. Daemon threads exist only to serve user threads. All threads spawned in a program are user threads, they can be set as daemon threads using the setDaemon(boolean) method.

  Was this answer useful?  Yes

littlebuddha

  • Oct 31st, 2005
 

Any Java thread can be a daemon thread. Daemon threads are service providers for other threads running in the same process as the daemon thread. For example, the HotJava browser uses up to four daemon threads named "Image Fetcher" to fetch images from the file system or network for any thread that needs one. The run() method for a daemon thread is typically an infinite loop that waits for a service request.

When the only remaining threads in a process are daemon threads, the interpreter exits. This makes sense because when only daemon threads remain, there is no other thread for which a daemon thread can provide a service.

To specify that a thread is a daemon thread, call the setDaemon() method with the argument true. To determine if a thread is a daemon thread, use the accessor method isDaemon().

-Little Buddha Quote

  Was this answer useful?  Yes

madhulatha

  • Nov 3rd, 2005
 

i don't know

  Was this answer useful?  Yes

madhulatha

  • Nov 3rd, 2005
 

i don't know

  Was this answer useful?  Yes

Srinivas Kallumadi

  • Nov 4th, 2005
 

Any Java thread can be a daemon thread. Daemon threads are service providers for other threads running in the same process as the daemon thread. For example, the HotJava browser uses up to four daemon threads named "Image Fetcher" to fetch images from the file system or network for any thread that needs one. The run() method for a daemon thread is typically an infinite loop that waits for a service request.

When the only remaining threads in a process are daemon threads, the interpreter exits. This makes sense because when only daemon threads remain, there is no other thread for which a daemon thread can provide a service.

To specify that a thread is a daemon thread, call the setDaemon() method with the argument true. To determine if a thread is a daemon thread, use the accessor method isDaemon().

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions