"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:mn***********************@spamgourmet.com...
There is nothing in the system that can set a CPU quota per process, all
you can do is give up your CPU slice by inserting wait's in your program,
but again why would you do this, CPU's are meant to execute instructions
not to wait.
Willy.
If you have a long-running CPU-intensive task, you might want to limit the
impact on the rest of the system by using just 80% (or so) of the
available cycles.
Hans Kesting
If there are ready to run threads in the system, they will get their share
of the CPU even if you have a long running CPU intensive task running, this
is how the scheduler works.
If you need to give more CPU time to other tasks that the long running task,
you can lower the active thread's priority, but doing so will not restrict
the CPU time to a certain level, all depends on the level of activity of the
other threads, if they are also CPU bound your thread's share will drop far
below 80%, if there are no realy active threads in the system, your thread
will still occupy most of the CPU time.
In short, you can't say I want this thread to be at most 80% on the CPU.
Note that it's not impossible to implement a kind of watch dog that changes
the thread(s) priority or reduces the thread's quantum of a process
depending on it's current activity and as such limit it's share of the
CPU's, SQL server has this so called throttle/governor built-in to prevent
tasks from consuming more than x resources (CPU and others).
Willy.