by polygot · 8y ago · 0 comments
On 10.6, when I ran Windows in a virtual machine while it was doing windows update, and left it running in the background for a few minutes and returned to it, sometimes I would get 60fps in the machine for a few seconds and it updated very very fast, and then it went back to 15fps (seemingly getting more CPU power.)
On 10.7 (if I recall) if I left Activity Monitor running in the background for a few minutes and returned to it, I would get nonsensical values for the CPU usage for a few seconds (e.g. 398423.34%) but then it would return to normal. Perhaps this error has been accumulating over the years.
For example, the CPU percentage counter in Activity Monitor was around 3,000,000. If there was a loop to increment the CPU usage counter, it sounds like it incremented it so fast that the thread that reset it didn't run since it wasn't scheduled to run (as it only runs every few seconds.) Again, this is just pure speculation and if anyone knows otherwise please let me know!
My assumption was/is that it refreshes stuff on a timer. On each timeout it puts a refresh event on some kind of queue... and then somehow manages to fuck it up, and ends up having a bunch of these events to deal with all at once, rather than handling each one as it comes in with a sensible gap between each one. Well, sometimes it happens, and don't ask me how I know.
But I have to say that you usually don't release it like that :(