|
If you want to best tools you must be write it and c++ has good functions for processes and threads for example QueryProcessCycleTime or GetThread*.
|
|
|
|
|
Thanks Hamid,
I think my requirement is common and I am quite surprised to see there is no such existing tools.
regards,
George
|
|
|
|
|
|
Thanks toxcct,
1.
I have tried and it looks good. I right client the running application, then select properties, then go to Threads Tab. Do you mean this solution?
2.
If yes, how to monitor the status of threads I mentioned from Threads Tab? I only a value called CSwitch Data changes and I can see thread ID/call stack.
regards,
George
|
|
|
|
|
No you can find tools for monitor processes and threads for example you can use of Perfomance on the windows and also you can see source code of it on the MSDN (I personaly use of my tool because I am assured to it however its not complete but I use of it for processes and handles of programs ).
|
|
|
|
|
Thanks Hamid,
I do not think it could monitor the status of threads. If I am wrong, please feel free to correct me and show me what are your steps to use Perfmon to monitor thread status?
regards,
George
|
|
|
|
|
No Performance was for example.
|
|
|
|
|
What is the name of the tool you are using, Hamid?
regards,
George
|
|
|
|
|
|
Cool, Hamid!
Could you share your tool here please? And write a tutorial?
I think it will attract interests from many people.
regards,
George
|
|
|
|
|
I said its not complete and also I used of some functions that are not be safe like wsprintf and other problem is that my english is not good so I dont think my article will be good.
|
|
|
|
|
Hi Hamid,
No one will be very critical here. Code is better than English for us.
BTW: why wsprintf is not safe?
regards,
George
|
|
|
|
|
On the MSDN is:
Security Alert Using this function incorrectly can compromise the security of your application. The string returned in lpOut is not guaranteed to be NULL-terminated. Also, avoid the %s format -- it can lead to a buffer overrun. If an access violation occurs it causes a denial of service against your application. In the worse case, an attacker can inject executable code. Consider using one of the following alternatives: StringCbPrintf, StringCbPrintfEx, StringCbVPrintf, StringCbVPrintfEx, StringCchPrintf, StringCchPrintfEx, StringCchVPrintf, or StringCchVPrintfEx. You should review Security Considerations: Windows User Interface before continuing.
|
|
|
|
|
Thanks Hamid,
I am interested in two points,
1.
"string returned in lpOut is not guaranteed to be NULL-terminated" -- can you show me a sample please? I do not know this.
2.
"avoid the %s format -- it can lead to a buffer overrun" -- also, could you show a sample please? Previously, I think it is safe.
regards,
George
|
|
|
|
|
George_George wrote: For example, wait for a handle (convenient to analyze deadlock), sleep, running? Since my application deals with I/O heavily, it is good if the tool could monitor I/O thread's status -- e.g. sent request, waiting response or something?
Thread Status Monitor from Object Media[^].
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Looks like some 3rd party tool, are there any MS tools?
regards,
George
|
|
|
|
|
For such tools from MS, technet is the only place I can think of. If technet has nothing of that sort which would satisfy your needs, then there's probably no such tool from MS (I presume that you've searched technet for your requirement).
Just curious, is there a reason why you want it to be from MS?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks Rajesh!
If it is MS tool, I think more people will use it and more popular, so when I met with issues, I can come to forums to ask.
BTW: do you use the 3rd party tool on Windows Server 2003 x64? Do you think it is reliable?
regards,
George
|
|
|
|
|
I've personally not used it; but I've heard the tool is OK, from a colleague who had been using it. At least it is free.
See if this[^] helps as well.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks Rajesh,
I will try this tool.
regards,
George
|
|
|
|
|
I think its detail is limited,right?
|
|
|
|
|
Detail of what? What is the tool you are talking about?
regards,
George
|
|
|
|
|
No it was a reply to Rajesh .
|
|
|
|
|
I am not sure if I get your question right there. It just lets you know the thread status, context, etc., (refer to the image on the link I provided). It does not come with source code, but it is not a limited or a trial version.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Good.
regards,
George
|
|
|
|