Active threads in ExecutorService

后端 未结 6 1534
盖世英雄少女心
盖世英雄少女心 2020-12-23 19:16

Any ideas how to determine the number of active threads currently running in an ExecutorService?

6条回答
  •  一个人的身影
    2020-12-23 19:44

    Place a static volatile counter on the thread which is updated whenever the thread is activated and deactivated. Also, see the API.

提交回复
热议问题