Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Threadpool的cpu负载统计好像有问题 #215

Open
Nic-bit opened this issue Feb 27, 2024 · 1 comment
Open

Threadpool的cpu负载统计好像有问题 #215

Nic-bit opened this issue Feb 27, 2024 · 1 comment

Comments

@Nic-bit
Copy link

Nic-bit commented Feb 27, 2024

截屏2024-02-27 20 30 08
线程池的run函数这里,使用startSleep()和sleepWakeUp()来获取线程执行时间和休眠时间,虽然两个都加锁,但是多线程多cpu的情况下,统计的执行时间和休眠时间不对,理想情况下一个ThreadLoadCounter只统计一个线程的运行数据。eg:可以对单个线程记录开始时间戳和结束时间戳。

@xia-chu
Copy link
Member

xia-chu commented Feb 28, 2024

确实 这个只能统计一个线程的负载情况 在多个线程的情况下 应该关闭这个统计

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants