gpt4 book ai didi

java - 不同的 (HotSpot) JVM 线程类型有什么作用?

转载 作者:太空狗 更新时间:2023-10-29 22:57:37 31 4
gpt4 key购买 nike

我看到在 HotSpot JVM 中实现了六种线程类型:VMThread、CGCThread、PGCThread、JavaThread、CompilerThread 和 WatcherThread。但是我不知道哪种线程类型在做什么。到目前为止,这是我的理解:

  • VMThread:运行 VM 任务,如垃圾收集器。
  • CGCThread:并发垃圾收集器。
  • PGCThread:并行垃圾收集器(与 CGC 的区别?)。
  • JavaThread:我猜是程序的线程。
  • CompilerThread:编译器线程?
  • 观察线程: ?

附加问题:其他 JVM 呢?

最佳答案

您可以在 OpenJDK website 上找到简要说明。 :

The main kinds of VM threads are as follows:

  • VM thread: This singleton instance of VMThread is responsible for executing VM operations, which are discussed below
  • Periodic task thread: This singleton instance of WatcherThread simulates timer interrupts for executing periodic operations within the VM
  • GC threads: These threads, of different types, support parallel and concurrent garbage collection
  • Compiler threads: These threads perform runtime compilation of bytecode to native code
  • Signal dispatcher thread: This thread waits for process directed signals and dispatches them to a Java level signal handling method

您可能想阅读整个线程管理段落,因为它继续进行进一步的解释,例如VM 线程负责什么。

关于java - 不同的 (HotSpot) JVM 线程类型有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15251250/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com