• Post Reply Bookmark Topic Watch Topic
  • New Topic

using setDaemon and join methods on the same thread  RSS feed

 
Stu Johns
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is it a bad idea to use setDaemon(true) and join() on the same thread?
I am thinking this because the setDaemon will make the thread a low priority and the join() method waits for it to finish which may be a very long wait on a busy operating system.

anyone have any experience or opiniions on this question?

appreiciate any help

thanks

Stu.
 
Henry Wong
author
Sheriff
Posts: 22864
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stu Johns wrote:
Is it a bad idea to use setDaemon(true) and join() on the same thread?
I am thinking this because the setDaemon will make the thread a low priority and the join() method waits for it to finish which may be a very long wait on a busy operating system.


The priority of a thread is independent of its deamon status. It is possible to have a very high priority deamon thread.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!