在所有其他用户线程完成后,由守护线程生成的用户线程是否继续存在?
Is a user thread spawned by a daemon thread continue to live after all other user threads are completed?
根据文档:
If all users thread are completed, all daemon threads are abruptly stopped and program is over, and until at least 1 user thread is alive the program is alive.
所以我的问题的直观答案是:
"Is a user thread spawned by a daemon thread continue to live after all other user threads are completed?"
是:它继续存在。
但是听到了相反的意见,求助
是的,如果其他非守护线程已完成,非守护线程将继续 运行。这与非守护线程的创建方式无关,即创建线程是否是守护线程。
根据文档:
If all users thread are completed, all daemon threads are abruptly stopped and program is over, and until at least 1 user thread is alive the program is alive.
所以我的问题的直观答案是: "Is a user thread spawned by a daemon thread continue to live after all other user threads are completed?" 是:它继续存在。
但是听到了相反的意见,求助
是的,如果其他非守护线程已完成,非守护线程将继续 运行。这与非守护线程的创建方式无关,即创建线程是否是守护线程。