Skip to content

Commit

Permalink
docs: fix wrong example
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed Jan 5, 2024
1 parent 513cc39 commit a159504
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/content/docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ What will happen if both request are almost simultaneously executed ?
1. User A's request reads the balance of Account C : **We get 1000$**
2. Concurrently, User B's request also reads the balance of Account C: **We also get 1000$ since User A's request hasn't been fully executed yet**
3. User A's request adds 100$ to Account C's balance : **Account C now has 1100$**
4. Almost simultaneously, User B's request does the same. But remember, we stored the balance of Account C in a variable, and we added 100$ to it. So we also get **1100$ + 100$ = 1200$**.
4. Almost simultaneously, User B's request does the same. But remember, we stored the balance of Account C in a variable, and we added 100$ to it. So we also get **1000$ + 100$ = 1100$**.

See the problem ? That means, Account C will end up with 1100$ instead of 1200$. And even worse, User A and User B have been debited 100$ each, but only 100$ has been credited to Account C.

Expand Down

0 comments on commit a159504

Please sign in to comment.