Detecting a freeze

jwh

Well-known member
Joined
Aug 18, 2006
Messages
155
Programming Experience
3-5
I have an application that has multiple background threads that loop for tasks eg every 10 secs etc.

I obviously also have my gui thread that the users interact with.

In this particular market (epos) there is absolutely no delays allowed, but sometimes ( and it can be days of use before this happens) there is a freeze of a few seconds and then the system catches up again with the user.

Is there any way I can detect this?

One way I thought of, but I don't know what effect this would have in terms of overhead, is create a system where at the start of a potentially problematic or time consuming procedure the code calls another sub, telling it the name of the procedure, and the expected duration in ms.

Have another sub the execs at the end of the potential problems, just to check in that the sub has completed. If the sub took longer than expected, then log it for further investigation.


What do you guys think?
 
Back
Top