views:

31

answers:

1

The windows service I am writing will need to run some processor intensive operations once in a while (sound encoding wav -> mp3) on a machine that takes part in real time voice communication (so I cannot just run them any-time).

What would you check (what counters maybe) before running such operation?

Can you point me to any good articles?

+3  A: 

Let the OS do the scheduling for you, as it was designed.

Assign the idle priority to your process. That's it!

Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.Idle;
Mike Atlas
Sounds awesome! :) - is there a way to make sure that the process will finish what it has to do, while running on a machine under heavy load (or just weak)? Something like a priority of the process rising with time?
kyrisu
In that case, just use ProcessPriorityClass.BelowNormal.
Mike Atlas
Also, consider using a Job Scheduler if you want an easy out-of-the-box way to track these kinds of things. http://quartznet.sourceforge.net/
Mike Atlas