Click to See Complete Forum and Search --> : How can we find out the order of threads in which they ran in the process?
Somu
May 2nd, 2003, 07:47 AM
Hi,
My application is using C++/Win32 APIs on Windows NT.
Is it possible to take the snap shot of the process i.e. all the statistics that what it were doing,in what order threads were executed etc.?
Regards
Somu
dimm_coder
May 2nd, 2003, 08:13 AM
Take a look onto PSAPI (search for EnumProcesses(),...) lib
or PDH lib.
Somu
May 2nd, 2003, 08:37 AM
Thanks for the quick reply.
But I do not want to enumerate threads simply.I want the history about what it was doing 2 mins before some problem occurs?At that point of time I want to what all threads were running and in what order they were scheduled?
Regards
Somu
dimm_coder
May 2nd, 2003, 08:46 AM
Hmm... In this case U need to write any sheduler which will be take a system info U need time to time (for some time interval).
Somu
May 2nd, 2003, 08:48 AM
But how can we do that?
dimm_coder
May 2nd, 2003, 08:52 AM
Seems that U need to have info for debug purpose if your app has
crushed. But for this purpose it is better to use debug version of program (with debug symbols,...) and set options in system to create a crush dump file when any problems has place (crushed).
Take a look for ex to DrWatson for Win.
Somu
May 2nd, 2003, 08:56 AM
Ni.I have already handled the crash scenarios and get enough info at the time of the crash.The problem which I had mentioned can be any like timeout of the reply or delayed reply of the request from the another process. Basically for these scenarios I need the history.
dimm_coder
May 2nd, 2003, 09:02 AM
Write messages to log-file from diff places (diff threads) .
By this way U will know last place and params(U wrote)
had execution.
This is appropriate way.
Somu
May 2nd, 2003, 09:04 AM
This I already doing.I have very exhasutive logger for my application.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.