12-24-2005 10:20 AM
12-27-2005 09:18 AM
Thread priority only controls how the OS thread scheduler allocates threads to the CPU. Any thread can cause a high CPU load depending on what it is doing. If your thread runs a tight loop or calls a function that runs a tight loop then you would see high CPU usage. But this should not be a problem if your thread is of normal priority because then other normal priority and higher priority threads can preempt your thread - only lower priority threads will be affected. Calling functions like RunUserInterface sometimes cause this behavior (seemingly high CPU usage) because RunUserInterface is basically a loop that is polling for UI and other events.
You should find out which functions your threads are executing when you see this high CPU usage. Sometimes you can workaround this by changing these functions - like replacing RunUserInterface with a loop calling ProcessSystemEvents and Sleep. As I mentioned above, higher than expected CPU usage should not be a problem when it is happening on normal or low priority threads. But if this is really affecting your application/system (doubtful) then you should narrow down the functions your threads are in when you see this problem.
Best regards
12-27-2005 05:01 PM