What are atomic actions and why they are neccessary? Also, How are atomic actions implemented in Java?
My understanding is that in programming an atomic action is one that effectively happens all at one. An atomic action cannot stop in the middle it either happens completely or not at all.
For example, ordering an airline ticket online where two actions are required: payment and a seat reservation. The potential passenger must either.
- both pay and reserve a seat, OR
- neither pay nor reserve a seat