General Concurrency Question

Written by
reddit
Link to Post

https://www.reddit.com/r/golang/comments/bnbsol/general_concurrency_question/ by 

I was watching this Stanford Course and I was intrigued when the lecturer gave the example of ATMs — https://youtu.be/Ps8jOj7diA0?t=550 (9:00)

My question is lets say you have a shared resource (bank) and two processes (ATMs) and they are all synced time wise. There is $100 and at the EXACT time I execute a withdraw of $100 from both ATMs how is the bank able to determine the validity of the request? I understand you can lock, do transaction, and unlock but what happens if the transaction is exactly at the same time.

I know in the real world there is slippage in time but this is more of a theoretical question.

submitted by /u/uragnorson
[link] [comments]

Article Tags:
· ·
Article Categories:
reddit

Leave a Reply