↗Resource
↗Gutes visuelles Tool für Deadlock-Szenarien
nina · 5 h ago
Ich habe ein Tool gefunden, das Deadlocks Schritt für Schritt visualisiert — hat mir sehr geholfen, das Dining-Philosophers-Problem zu verstehen.
Beispiel für ein klassisches Deadlock-Muster:
// Thread 1 // Thread 2
synchronized (a) { synchronized (b) {
synchronized (b) { synchronized (a) {
// ... // ...
} }
} }
Merkregel: Locks immer in einer global konsistenten Reihenfolge nehmen.
▲ 0 · Log in to join in
