更新时间:2023-01-16 11:24:54
的发
对象会立刻进行垃圾回收,因为它是不再使用,即调用后,立即启动
方法。 (它将但不会立即作为垃圾收集器在特定时间运行收集。)
The Thread
object will be eligible for garbage collection as soon as it's not used any more, i.e. immediately after calling the Start
method. (It will however not be collected immediately, as the garbage collector runs at specific times.)
实际的线程但不依赖于主题
对象,并将继续即使发
对象收集运行。
The actual thread however is not relying on the Thread
object, and will continue to run even if the Thread
object is collected.
如果线程仍在运行时的主要方法退出时,应用程序将不会结束,直到线程完成,除非您已标记线程是一个后台线程。
If the thread is still running when the main method exits, the application will not end until the thread completes, unless you have marked the thread to be a background thread.