3 ms·
> What kind of periodic interval can you recommend that would be generally applicable, how should the deadlock handler react in such a situation etc. periodic d
by psykotic 15y ago
> What kind of periodic interval can you recommend that would be generally applicable, how should the deadlock handler react in such a situation etc. periodic detection will make the deadlock handler harder to write.
The question of how the deadlock handler should be respond is what his slide was about. You need to have a way of returning a standardized error from lock() to signal a deadlock. That's the exception type he calls DeadlockError. You send those signals to enough waiters to break the detected cycles in the graph.
As for the checking interval, there's no simple answer. Engineering is often like that. It doesn't mean you give up and abandon the idea. We can define desirable criteria and go from there: the interval needs to be adaptive, long-waiting threads might boost the priority of the deadlock detector thread, etc.
For what it's worth, I agree with your overall assessment of his suggestions.