Paper , Order, or Assignment Requirements
THERE IS 2 `SECTION TO THIS SO FOLLOW BELOW.
It is strongly advised to follow the outline of the Seminars sheets (Seminar 4 and 5) and Lab sheets (Seminar 4 and 5).
Scenario for the assignment: Concurrency problems with banking; service example is a deposit function and a transfer function; the problems to be considered are mutual exclusion and deadlock.
Simple example scenario: Access to a banking account allows getting the current amount in the bank account (get_balance) and setting a new amount in the account (set_balance). Based on these two functions, a third function deposit needs to be implemented that allows putting a certain amount of money into the account (deposit). In addition, a function transfer that takes out money from one account and deposits it into another account must be implemented and tested (testfiles to be provided).
We consider an environment where parallel execution of processes is possible. This may create concurrency issues if two processes access one account (inference) and if two transfers happen simultaneously between two accounts (deadlock). You should use semaphore(s) (or monitor(s)) to resolve these issues.