Problem
I am creating a Windows 7 based C# WPF application using .Net 4.5, and one its major features is to <
Which of the 5 options is guaranteed to fix this problem?
This depends on what accuracy your are trying to achieve. If you're aiming for say +/- 1ms, you have a reasonable chance to get it done without points 3) to 5). The combination of points 1) and 2) is the way to go:
THREAD_PRIORITY_HIGHEST(2)
as the maximimum priority. Therefore you'd have to look into the SetThreadPriority function which allows access to THREAD_PRIORITY_TIME_CRITICAL (15)
. The Process::PriorityClass Property allows to access REALTIME_PRIORITY_CLASS (24)
. Note: Code running at such priorities will push all other code out of the way. You'd have to make the code with very littly computation and very safe.General remarks: All depends on load. Windows can do pretty well despite the fact that it is not a "realtime OS". However, also realtime systems rely on low load. Nothing is guaranteed, not even on an RT-OS when it is heavily loaded.