[concurrency-interest] Termination of daemon threads

David Holmes dcholmes at optusnet.com.au
Tue Apr 1 02:44:18 EDT 2008


No, daemon status can only be modified before a thread is started.

David Holmes

> -----Original Message-----
> From: concurrency-interest-bounces at cs.oswego.edu
> [mailto:concurrency-interest-bounces at cs.oswego.edu]On Behalf Of Richard
> Zschech
> Sent: Tuesday, 1 April 2008 4:20 PM
> To: concurrency-interest at cs.oswego.edu
> Subject: Re: [concurrency-interest] Termination of daemon threads
> 
> 
> Couldn't you go setDaemon(false) / setDaemon(true) around your critical
> sections?
> 
> >From Richard.
> 
> 
> -----Original Message-----
> From: concurrency-interest-bounces at cs.oswego.edu
> [mailto:concurrency-interest-bounces at cs.oswego.edu] On Behalf Of David
> Holmes
> Sent: Tuesday, 1 April 2008 3:12 PM
> To: jim.andreou at gmail.com; concurrency-interest at cs.oswego.edu
> Subject: Re: [concurrency-interest] Termination of daemon threads
> 
> A daemon thread should never do anything critical. Daemon threads just
> "vanish" when the process is terminated. Though for Sun's VM they are at
> least brought to a system "safe-point" first - though executing native
> code
> is considered being at a "safe-point" ie outside of the VM.
> 
> It probably could be documented better.
> 
> David Holmes
> 
> > -----Original Message-----
> > From: concurrency-interest-bounces at cs.oswego.edu
> > [mailto:concurrency-interest-bounces at cs.oswego.edu]On Behalf Of
> Dimitris
> > Andreou
> > Sent: Tuesday, 1 April 2008 2:02 PM
> > To: concurrency-interest at cs.oswego.edu
> > Subject: [concurrency-interest] Termination of daemon threads
> >
> >
> > Hi all,
> >
> > Here is my question: How are daemon threads terminated? What if they
> are
> > in the middle of a critical operation, like writing to a file? They
> seem
> > to exit immediately. How could that be safe? Or a daemon thread should
> > never do anything critical, but always delegate such work to a
> > non-daemon thread? If any case, shouldn't it be documented in
> > java.lang.Thread?
> >
> > Thanks
> > Dimitris Andreou
> >
> > _______________________________________________
> > Concurrency-interest mailing list
> > Concurrency-interest at altair.cs.oswego.edu
> > http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
> >
> 
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
> 
> !DSPAM:1,47f1c9bc745732238521400!
> 
> 
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
> 


More information about the Concurrency-interest mailing list