Skip to lesson

Bank transfers without deadlock

A bank transfer touches two accounts, so it needs two locks, and two transfers that take those locks in opposite order can wait for each other forever. Taking the locks in one fixed order, smallest account id first, makes that circle impossible.

Sign in to continue this lesson

Create an account to read every lesson, practise with the exercises and keep track of your progress.