-
problem in threads
Hi iam a beginer .i want to run a daemon thread,as the program does not wait for the daemon thread we are not able to see the out put that we write in the daemon thread .How can we know daemon is alive even after the program is terminated .Please help me with an example.thank you .
-
The daemon thread will by definition die when the program is terminated. Check out this link about threads. It has some good examples.
http://www.unix.org.ua/orelly/java/exp/ch06_01.htm
-
 Originally Posted by Joe Beam
this is regarding ur reply to me .this is the text i cut from the book u sent to me, read it once.read the last line from the paragraph
In many cases, what we really want is to create background threads that do simple, periodic tasks in an application. The setDaemon() method can be used to mark a Thread as a daemon thread that should be killed and discarded when no other application threads remain. Normally, the Java interpreter continues to run until all threads have completed. But when daemon threads are the only threads still alive, the interpreter will exit.
-
Ya, if daemon threads are the only ones left the interpreter exits (i.e. the daemon threads are destroyed)
Similar Threads
-
By JohnsonGPS in forum C++
Replies: 3
Last Post: 11-16-2005, 06:15 PM
-
By vikassheelgupta in forum Java
Replies: 0
Last Post: 07-22-2005, 05:35 AM
-
Replies: 2
Last Post: 02-16-2002, 10:51 AM
-
Replies: 0
Last Post: 12-13-2001, 12:06 PM
-
By Wade Balzer in forum VB Classic
Replies: 0
Last Post: 06-23-2000, 02:17 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|