DevPartner and WaitForSingleObject
-
I am doing some code profiling on my project to try and identify any speed bottlenecks - I am using DevPartner community edition from Compuware - when I run the tests my project spends about 90% in WaitForSingleObject, Sleep and SleepEx - why would it do that? The program isn't multithreaded and the main part of the program I am testing has no user interraction - it's basically some IO and a lot of bit shifting. TIA
-
I am doing some code profiling on my project to try and identify any speed bottlenecks - I am using DevPartner community edition from Compuware - when I run the tests my project spends about 90% in WaitForSingleObject, Sleep and SleepEx - why would it do that? The program isn't multithreaded and the main part of the program I am testing has no user interraction - it's basically some IO and a lot of bit shifting. TIA
PaleyX wrote: it's basically some IO You have to wait for the I/O finish. Often this is done by the CLR using WaitForSingleObject, because some I/O classes only implement asynchronous interfaces (Begin*/End*) - the synchronous versions of these methods simply call the Begin/End pair. What you're seeing is that your program is spending 90% of the time blocked by I/O. Maybe multithreading would help you a bit. Yes, even I am blogging now!
-
PaleyX wrote: it's basically some IO You have to wait for the I/O finish. Often this is done by the CLR using WaitForSingleObject, because some I/O classes only implement asynchronous interfaces (Begin*/End*) - the synchronous versions of these methods simply call the Begin/End pair. What you're seeing is that your program is spending 90% of the time blocked by I/O. Maybe multithreading would help you a bit. Yes, even I am blogging now!