简体   繁体   中英

Daemon and non-daemon thread priority in Java

I know how the JVM treats daemon and non-daemon threads when the main thread terminates. I wonder if there is any difference in priority of daemon and non-daemon threads?

No there is no difference in priority between Daemon and non-daemon thread priority in Java, you can define priority or it will be inherited from parent

From JavaDoc :

The priority of the newly created thread is set equal to the priority of the thread creating it, that is, the currently running thread

Oracle Java Doc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM