The Deadlock Empire: An Interactive Guide to Locks
deadlockempire.github.io
The Deadlock Empire: An Interactive Guide to Locks
1–10 of 44 posts
Re: The Deadlock Empire: An Interactive Guide to Locks
#2There go my dreams of being a C-slinging kernel ninja master.
Re: The Deadlock Empire: An Interactive Guide to Locks
#3It stops before the problems of lock congestion, infinite overtaking, and priority inversion, though.
Re: The Deadlock Empire: An Interactive Guide to Locks
#4My main takeaway from this excellent guide is that I suck at multithreaded reasoning and should stick to single threaded languages. There go my dreams of being a C-slinging kernel ninja master.
The big win in Rust is that the mutexes are tied to the data they protect. The compiler won't let you access data until it's locked. You can still deadlock, though.
Re: The Deadlock Empire: An Interactive Guide to Locks
#5My main takeaway from this excellent guide is that I suck at multithreaded reasoning and should stick to single threaded languages. There go my dreams of being a C-slinging kernel ninja master.
Re: The Deadlock Empire: An Interactive Guide to Locks
#6Re: The Deadlock Empire: An Interactive Guide to Locks
#7My main takeaway from this excellent guide is that I suck at multithreaded reasoning and should stick to single threaded languages. There go my dreams of being a C-slinging kernel ninja master.
Unless you know what you're doing, just pick the real low-hanging fruit, like throwing some threads at file block decompression.
Re: The Deadlock Empire: An Interactive Guide to Locks
#8My main takeaway from this excellent guide is that I suck at multithreaded reasoning and should stick to single threaded languages. There go my dreams of being a C-slinging kernel ninja master.
A lock should be used to lock a data structure, that's it. Corollary: Never hold a lock while calling a function.
Most common deadlocking scenario is people taking a lock, calling a function, that they don't know takes a different lock. If you can't get by just taking a lock, touching some data structure (lightly), and releasing the lock then you need to look at your data structures.
Re: The Deadlock Empire: An Interactive Guide to Locks
#9Oh, that's just precious. It stops before the problems of lock congestion, infinite overtaking, and priority inversion, though.
Re: The Deadlock Empire: An Interactive Guide to Locks
#10It's missing my favourite optimistic lock, the Delusional Lock.