VerySleepy Profiling c++ code -
while profiling code find going slow, have 3functions taking forever apparently, thats sleepy says.
these functions are:
zwdelayexecution 20.460813 20.460813 19.987685 19.987685 msgwaitformultipleobjects 20.460813 20.460813 19.987685 19.987685 waitforsingleobject 20.361805 20.361805 19.890967 19.890967 can tell me these functions are? why taking long, , how fix them.
thanks
probably functions used make thread 'sleeping' in win32 api. might used thread synchronization check these thing.
they taking cpu time because designed that.
the waitforsingleobject function can wait following objects:
- change notification
- console input
- event
- memory resource notification
- mutex
- process
- semaphore
- thread
- waitable timer
so other possible thing can used console user input waiting.
zwdelayexecution internal function of windows. can seen used realize sleep function. here call stack sleep function can see own eyes:
0 ntdll.dll zwdelayexecution 1 kernel32.dll sleepex 2 kernel32.dll sleep it probaly uses assembly low-level features realize can delay thread precision of 100ns.
msgwaitformultipleobjects has similar waitforsingleobject goal.
Comments
Post a Comment