CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 1999
    Posts
    36

    Question How can we find out the order of threads in which they ran in the process?

    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

  2. #2
    Join Date
    Sep 2002
    Location
    Belarus - Tirol, Austria
    Posts
    647
    Take a look onto PSAPI (search for EnumProcesses(),...) lib
    or PDH lib.
    "UNIX is simple; it just takes a genius to understand its simplicity!"

  3. #3
    Join Date
    Aug 1999
    Posts
    36
    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

  4. #4
    Join Date
    Sep 2002
    Location
    Belarus - Tirol, Austria
    Posts
    647
    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).
    "UNIX is simple; it just takes a genius to understand its simplicity!"

  5. #5
    Join Date
    Aug 1999
    Posts
    36
    But how can we do that?

  6. #6
    Join Date
    Sep 2002
    Location
    Belarus - Tirol, Austria
    Posts
    647
    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.
    "UNIX is simple; it just takes a genius to understand its simplicity!"

  7. #7
    Join Date
    Aug 1999
    Posts
    36
    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.

  8. #8
    Join Date
    Sep 2002
    Location
    Belarus - Tirol, Austria
    Posts
    647
    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.
    "UNIX is simple; it just takes a genius to understand its simplicity!"

  9. #9
    Join Date
    Aug 1999
    Posts
    36
    This I already doing.I have very exhasutive logger for my application.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured