I use ladders to explain deadlocks: People can walk up the ladder or down the ladder, but everyone has to choose the same direction on any given ladder. If someone walks up the ladder from the bottom while someone else is walks down from the top, when they meet, either they'll be stuck indefinitely, or someone has to back out. Row access works the same way - if everyone walks/locks rows/ladder rungs in the same order, you'll have the above-described Starbucks situation, at the worst.
That said, using young children with toys as analogies is valid for many problems, both modern and of-old.
I enjoy your posts. Hope you don't mind an Oracle DBA reading your stuff. :-)
1 comment:
I use ladders to explain deadlocks: People can walk up the ladder or down the ladder, but everyone has to choose the same direction on any given ladder. If someone walks up the ladder from the bottom while someone else is walks down from the top, when they meet, either they'll be stuck indefinitely, or someone has to back out. Row access works the same way - if everyone walks/locks rows/ladder rungs in the same order, you'll have the above-described Starbucks situation, at the worst.
That said, using young children with toys as analogies is valid for many problems, both modern and of-old.
I enjoy your posts. Hope you don't mind an Oracle DBA reading your stuff. :-)
Post a Comment