您的位置 首页 > 数码极客

daemon、daemon x machina? daemon是什么意思

大家都知道,在Java中有两种线程:User Thread(用户线程)和DaemonThread(守护线程)。那它们有何区别呢?

守护线程

What is Daemon thread?

Daemon thread is a low priority thread that runs in background to perform tasks such as garbage collection.

守护线程是一个低优先级的线程,它在后台运行,执行像垃圾收集等任务。

Properties:

1.They can not prevent the JVM from exiting when all the user threads finish their execution.

它们不能阻止JVM在所有用户线程执行完毕后退出。

2.JVM terminates itself when all user threads finish their execution.

当所有用户线程执行完毕后,JVM自行终止。

3.If JVM finds running daemon thread, it terminates the thread and after that shutdown itself. JVM does not care whether Daemon thread is running or not.

如果JVM发现正在运行的守护进程线程,它就会终止该线程,然后关闭自己。JVM并不关心Daemon线程是否在运行。

4.It is an utmost low priority thread.

守护线程是一个最低级别的线程。

责任编辑: 鲁达

1.内容基于多重复合算法人工智能语言模型创作,旨在以深度学习研究为目的传播信息知识,内容观点与本网站无关,反馈举报请
2.仅供读者参考,本网站未对该内容进行证实,对其原创性、真实性、完整性、及时性不作任何保证;
3.本站属于非营利性站点无毒无广告,请读者放心使用!

“daemon,daemon,x,machina,daemon,tools,Lite,daemon,tools”边界阅读