I am making a script with multiple threads, and one of the threads I wish to make is a "cpu usage monitoring thread" that checks both "overall" cpu usage and the "current script cpu usage" or external PID cpu usage.
Then I can decide if any of my threads need to sleep for the moment while CPU is recovering from something (like maybe its executing something heavy) then my perl script needs to adjust.
I wish it will also be EFFICIENT and ACCURATE as much as possible. I don't want the perl script have high CPU usage. Cross Platform would be nice, but if a Windows Solution is more efficient. Please share.
For now I can't find any good solution. 🙁
submitted by /u/DemosaiDelacroix
[link] [comments]