GC 会停止 .NET 中的所有应用程序线程吗?
Does GC stop all app threads in .NET?
我正在阅读 article 关于优化 .Net 应用程序性能的内容。作者声明
it shows what the main thread did during all those GCs. Most of the time (97.3%) it was Waiting. This means that GC took place on some other thread (obviously on the FileProcessing thread) and the main thread had to wait until the GCs were finished.
据我所知,.Net GC 是 stop-the-world 收集器。因此,如果您的主线程正在等待,则意味着所有其他线程也必须在等待。除了 GC 线程本身。
文章过时了还是我理解错了?
原因是在单独的线程中发生的后台 GC 和与触发 GC 的线程在同一线程上运行的阻塞 GC 之间存在误解。
我正在阅读 article 关于优化 .Net 应用程序性能的内容。作者声明
it shows what the main thread did during all those GCs. Most of the time (97.3%) it was Waiting. This means that GC took place on some other thread (obviously on the FileProcessing thread) and the main thread had to wait until the GCs were finished.
据我所知,.Net GC 是 stop-the-world 收集器。因此,如果您的主线程正在等待,则意味着所有其他线程也必须在等待。除了 GC 线程本身。
文章过时了还是我理解错了?
原因是在单独的线程中发生的后台 GC 和与触发 GC 的线程在同一线程上运行的阻塞 GC 之间存在误解。