concurrent and distributed systems final questions?

concurrent system using (FSP) and using (LTSA)

Two warring neighbours are separated by a field with berries. They agree to permit each other to enter the field to pick berries, but also need to ensure that only one of them is ever in the field at a time. After negotiation, they agree to the following protocol. When one neighbour wants to enter the field, he raises a flag. If he sees his neighbour's flag, he does not enter but lowers his flag and tries again. If he does not see his neighbor's flag, he enters the field and picks berries. He lowers his flag after leaving the field. Model this algorithm for two neighbours, NEIGHBOUR1 and NEIGHBOUR2. Specify the required safety property for the field and check that it does indeed ensure mutually exclusive access. Specify the required progress properties for the neighbours such that they both get to pick berries given a fair scheduling strategy. Are there any adverse circumstances in which neighbors would not make progress? What if the neighbors are greedy? 

 Propose an FSP specification modelling this scenario and explain your modelling choices

Check the properties mentioned and explain the results.

Consider using a turn indicator (which can take the values 1 or 2) to avoid deadlock and provide an enhanced FSP specification for this scenario: if a neighbor sees his neighbour’s flag and it is his neighbour’s turn, he may not enter, but must try again later. Check that it does indeed avoid deadlock and satisfy the properties

There are no answers yet.
Be the first to answer this question.