The MASM Forum Archive 2004 to 2012

General Forums => The Laboratory => Topic started by: hutch-- on May 09, 2005, 02:22:21 PM

Title: Note to Jibz on Sleep() API
Post by: hutch-- on May 09, 2005, 02:22:21 PM
Jibz,

I had no way of reprodcing your direct test using rar so I wrote a number of test pieces including the last one which was a callable exe that set its own priority to IDLE_PRIORITY_CLASS.

With this test piece I was able to reproduce the problem you mentioned. It effects nothing above tasks running IDLE_PRIORITY_CLASS.

With the calling app and the called app both running IDLE_PRIORITY_CLASS the processor usage displayed at 100% even though everything else still ran as normal. I tested your suggestion about setting the time delay in Sleep() to 1 or higher and by introducing the delay the processor usage dropped to the same as before either app was run.

I will use the sugestion in the shell_ex procedure as it is pointed at general purpose work and while I doubt tha there is much use for starting an idle priority thread from a calling app synchronously, the 1 millisecond delay in Sleep() sovles the problem you mentioned.