c++ - How to detect circular calls? -
I am looking for reasons to avoid deadlocks and strategies / devices and to detect them.
Another possible reason for the deadlock is that the blocking function has to call other blocking functions in a circular, so that in the end a call never returns.
Sometimes it is difficult to find out, especially in very large projects.
So, is there any device / library / technology which allows to automate the identification of circular calls in a program?
Edit: I mostly code in C and C ++, if possible, give any information about the language that applies to those languages. However, it seems that this subject is hardly included in SO, so the answers to other languages are also fine. Although it may be that although they consider a topic subject to themselves, if someone searches for it relevant thanks. Circular (or recursive) calls that try to get the same non-reentrant lock, blocking scenarios Is one of the easiest to debug: Locking is deterministic and can be easily checked when the application is locked, set the debugger to fire and understand the stack trace which are the locks and why. As a general solution to the problem of locking ... you can see in some libraries providing muted exchange, and find out that when you try to close the order on a mute x Are there. Such solutions can be complicated to implement properly, but once it ensures that you can not enter a dead end situation, because it compels all processes to get locks in one order. (I.e. if process A red brings it, and tries to get lock lb, whose ordering is correct, it can either be successful or lock, but whatever law LB is, law can not be trying to lock the ordering will not be hampered.) / html>
Comments
Post a Comment