|
From: Anthony J. <ant...@bt...> - 2005-01-12 20:47:53
|
> One change I've considered is rather than trying to calculate the CPU time > over the total life of the thread is to keep a count of the number of > times a > thread runs to the end of it's quantum. (knowing you've now attempted this, and had an issue, so maybe considering leaving that sorta idea)... Recently at work, under Windows XP I've been suffering from a process that 99.9% of the time is sleeping, but about twice a day it kicks in and uses 100% CPU for about 2 mins, and then goes back to sleep. Unfortunately it starves most of the other processes, making my machine practically unusable while its happening. Note that the process is constantly running - its lifespan is since the last time the machine was rebooted. With a prioritisation based off time since the process/thread started a process like this would probably tend to starve things 'cos over the whole lifespan of the thread it would appear well behaved, even though it sometimes isnt. I suspect a strategy similar to the one above, or some decaying type algorithm would handle this scenario much better. Just some food for thought Anthony |