problem in threads


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: problem in threads

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Posts
    4

    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 .

  2. #2
    Join Date
    Oct 2005
    Posts
    107
    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

  3. #3
    Join Date
    Jan 2006
    Posts
    4
    Quote Originally Posted by Joe Beam
    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
    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.

  4. #4
    Join Date
    Oct 2005
    Posts
    107
    Ya, if daemon threads are the only ones left the interpreter exits (i.e. the daemon threads are destroyed)

Similar Threads

  1. Replies: 3
    Last Post: 11-16-2005, 07:15 PM
  2. CMR problem
    By vikassheelgupta in forum Java
    Replies: 0
    Last Post: 07-22-2005, 06:35 AM
  3. Threads
    By Jonas in forum .NET
    Replies: 2
    Last Post: 02-16-2002, 11:51 AM
  4. Replies: 0
    Last Post: 12-13-2001, 01:06 PM
  5. Replies: 0
    Last Post: 06-23-2000, 03: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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center