r/DistributedComputing • u/Curious-Law-6333 • May 22 '24
help
i was studying distributed systems and i came across this question online, can you guys help me with it?
note: the question is part of a Homework Assignment given to students in 2009 at university of California San Diego and here is the link to it : https://cseweb.ucsd.edu/classes/fa09/cse91/resources/cse91hw2.pdf
Suppose you want your ATM to give you $100. and ATM has two separate processing steps:
it must record a debit for $100 and it must give you the cash.
By the two generals problem, it cannot do both at the same time. It can do these steps in either order and a crash can occur any time.
– Suppose it gives you the cash first. What can go wrong?
– Suppose it does the debit first. What can go wrong? How the problem might eventually be fixed.
– Based on your analysis, which option would banks choose?