Programmatically limit CPU Usage of a Thread running inside a Service
问题 I'm using VB9 (VS2008). I've created a Windows Service that indexes some folders regularly. Is there a way I can put an upper limit on the CPU usage depending upon the current system state, i.e., if the system is idle, the thread can use the CPU as much as it needs, but if there are other programs/processes running then it should use the CPU in way that does not make the system slow. 回答1: You can reduce the priority of the thread, in .Net via Thread.Priority Setting it to BelowNormal will