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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -