|
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
|
|
|
|
|
Check this article Monitoring Threads[^]. You can either write a script or code it in c++.
-Saurabh
|
|
|
|
|
Thanks Saurabh,
I read it and it looks like PowerShell scripts. I think my requirement is common. There is no such existing tools?
regards,
George
|
|
|
|
|
Since you need to monitor threads you assume that your requirement is common. But that is not the case! What exactly are you trying to do anyway? Do you want to spy other processes or monitor you own process?
-Saurabh
|
|
|
|
|
Thanks Saurabh,
I am using admin. Why do you think monitor status for threads (wait, executing or something) is not common? Any performance analysis needs such tools.
regards,
George
|
|
|
|
|
What do you mean by "I am using admin"??
If I want to analyze performance of an application I will use a profiler. I have no control over how threads will be scheduled, for how long they have to wait, etc. Hence knowing how long my thread waits for IO will lead me nowhere w.r.t. optimization. On the other hand profiler will tell me how much time each function takes and how many times it is called during an execution. Using this I can try to optimized expensive and more frequently functions.
By the way, Rajesh gave you perfect tool for monitoring threads but still you insist on tool from MS because there will be more help for it. What kind of support do you expect from a tool which just shows thread information? I mean there is nothing more to it other than displaying thread information.
-Saurabh
|
|
|
|
|
Thanks Saurabh,
Help from your guys are good enough now.
regards,
George
|
|
|
|