15RACE CONDITIONS

Image

A race condition occurs when two processes race to complete based on an initial condition that becomes invalid while the processes are executing. A classic example is transferring money between bank accounts:

  1. You have $500 in your bank account, and you need to transfer the entire amount to a friend.
  2. Using your phone, you log into your banking app and request a transfer of $500 to your friend.
  3. After 10 seconds, the request is still processing. So you log into the banking site on your laptop, see that your balance is still $500, and request the transfer again.
  4. The laptop and mobile requests finish within a few seconds of each ...

Get Real-World Bug Hunting now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.