ItAuto Posted October 15, 2008 Posted October 15, 2008 (edited) Hi everyone, I'm wondering if anyone else is noticing abnormally high CPU usage while waiting on ProcessWaitClose. I'm getting a range of 8-20% CPU usage by the AutoIt3 process while it stops on that statement, and it's usually around 14% This isn't too big of a deal, but it seems pretty excessive for a new Athlon X2 system and it's preventing my fans from dropping to their slowest setting. Page fault delta is about 50000 for the AutoIt process! I'm running Vista, Norton AV and Windows Defender (comes with Vista by default) - I would assume the problem arising from one of those things on my system. Any one else run into the same problem or figured out what is going on? I read that ProcessWaitClose polls for the existence of the process every 250ms - is there a way to slow that down? Thanks! BTW, AutoIt and the process in question are being run from the same user account. Edited October 15, 2008 by ItAuto
YourSpace Posted October 15, 2008 Posted October 15, 2008 if you want to slow it down you could make a udf func _proswaitclose($process) while ProcessExists ($process) sleep(500) wend endfunc where 500 is the time to wait between checking.
ItAuto Posted October 15, 2008 Author Posted October 15, 2008 if you want to slow it down you could make a udf...Ah, thanks, I wasn't thinking of a solution outside of ProcessWaitClose.Does anyone else get that high CPU usage / page fault rate?(If you want to check your page fault delta, from Windows Task Manager go to View -> Select Columns and check Page Fault Delta)PF Delta of 50000 is huge, 20x anything else running on my computer...
YourSpace Posted October 15, 2008 Posted October 15, 2008 is the cpu usage still as high with th emethid i gacve you above?
ItAuto Posted October 16, 2008 Author Posted October 16, 2008 is the cpu usage still as high with th emethid i gacve you above?No, it's much lower, thanks!What's odd is if I change the delay in your loop to 250ms, it still only uses 1-2% CPU and has page fault delta ~3500, so writing your own spin loop is more efficient than using the built-in function...Does ProcessWaitClose use different Windows API call than ProcessExists or something?
liteswap Posted November 6, 2008 Posted November 6, 2008 No, it's much lower, thanks!What's odd is if I change the delay in your loop to 250ms, it still only uses 1-2% CPU and has page fault delta ~3500, so writing your own spin loop is more efficient than using the built-in function...Does ProcessWaitClose use different Windows API call than ProcessExists or something?I've had this problem too - around 10-15% CPU utilisation which is way too high. The workaround works - but the function shouldn't chew up the CPU this way in the first place...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now