Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > JAVA Technologies
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 06-11-06, 05:18 PM   #1 (permalink)
Junior Member
 
anitha.s's Avatar
 
Join Date: Feb 2006
Location:
Posts: 58
Thanks: 0
Thanked 4 Times in 4 Posts
Thanks: 0
Thanked 4 Times in 4 Posts
Rep Power: 3 anitha.s has disabled reputation
Daemon Thread

What is the use of Daemon Theard?
How can we convert a thread to Daemon Thread?
Give example to Daemon Thread?
anitha.s is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-12-06, 08:21 PM   #2 (permalink)
Senior Member
 
Join Date: Dec 2006
Posts: 698
Thanks: 3
Thanked 15 Times in 12 Posts
Thanks: 3
Thanked 15 Times in 12 Posts
Rep Power: 10 abeethabsl has a spectacular aura about abeethabsl has a spectacular aura about abeethabsl has a spectacular aura about
Re: Daemon Thread

Hi,

In java we have two type of Threads : Daemon Thread and User Threads. Generally all threads created by programmer are user thread (unless you specify it to be daemon or your parent thread is a daemon thread). User thread are generally meant to run our programm code. JVM doesn't terminates unless all the user thread terminate.
On the other hand we have Daemon threads. Typically these threads are service provider threads. They should not be used to run your program code but some system code. These thread run paralley to your code but survive on the mercy of the JVM. When JVM finds no user threads it stops and all daemon thread terminate instantly. Thus one should never rely on daemon code to perform any program code.
For better understanding consider a well known example of Daemon thread : Java garbage collector. Garbage collector runs as a daemon thread to recalim any unused memory. When all user threads terminates, JVM may stop and garbage collector also terminates instantly.

Regards,
Abeetha.M
abeethabsl is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-12-06, 11:25 PM   #3 (permalink)
Senior Member
 
jasmine84's Avatar
 
Join Date: Oct 2006
Posts: 426
Thanks: 10
Thanked 29 Times in 25 Posts
Thanks: 10
Thanked 29 Times in 25 Posts
Rep Power: 12 jasmine84 is a glorious beacon of light jasmine84 is a glorious beacon of light jasmine84 is a glorious beacon of light jasmine84 is a glorious beacon of light jasmine84 is a glorious beacon of light jasmine84 is a glorious beacon of light
Re: Daemon Thread

Daemon threads are service providers for othet threads or objects.a daemon thread executes continously.It generally provides a background processing.

to make a thread as daemon thread

t.setDaemon(true);

to know if a thread is a daemon or not

boolean x=t.isDaemon();
jasmine84 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to jasmine84 For This Useful Post:
sk_kireeti (13-12-06)
Old 13-12-06, 12:54 PM   #4 (permalink)
Junior Member
 
anitha.s's Avatar
 
Join Date: Feb 2006
Location:
Posts: 58
Thanks: 0
Thanked 4 Times in 4 Posts
Thanks: 0
Thanked 4 Times in 4 Posts
Rep Power: 3 anitha.s has disabled reputation
Re: Daemon Thread

Thank you jasmine and abeeth
anitha.s is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread class Vs Runnable interface Sudhan JAVA Technologies 5 24-09-08 08:10 PM
thread - join() anitha.s JAVA Technologies 2 29-01-07 11:42 AM
OOPS No Thread for AS 400 shahaan OTHERS 0 15-10-06 03:13 AM
Round Robin Algo. WISDOM NETWORK ADMINISTRATION , HARDWARE & TROUBLESHOOTING 9 17-08-06 08:06 PM
Java Contest-7 with answers keerthi JAVA Technologies 11 26-03-06 03:06 AM


All times are GMT +6.5. The time now is 10:43 AM.





Search Engine Optimization by vBSEO 3.1.0