Exercise 4 (See DTM slides 39 - ... Voting based algorithms) When a process P needs access to a shared resource, it will send a message to M1, ... , Mn asking for the permission. Each M1, ... , Mn will answer yes if the lock on the resource can be granted right away, or waits until the resource becomes available and then answers yes. If there are multiple conflicting requests on a given resource, the first one will get the lock and the others are queued until the lock is freed. At this time the first process in the queue gets the lock. If the next process in the queue can be granted the lock without conflict, the lock is granted to that process as well. Others remain queued. The queue works in FIFO manner. If there is a queue on a given resource (i.e. the lock is granted to some process and there is at least one process in a queue waiting for the lock to be freed), and a non-conflicting lock request arrives, the new request is put to the back of the queue (as in FIFO). When the lock is freed, the next process in the queue is granted the lock as described above as long as there are processes in the queue.