In a networked system a locking service is provided by means of daemon processes, called local lock managers, running (one per host) on each host in the system. Applications request lock operations by calling a function which sends messages to its local lock manager. The available operations are: LOCK - which doesn't return until the lock is granted TRYLOCK - which returns immediately UNLOCK The TRYLOCK operation must return a value indicating whether or not the lock was obtained. To provide consistency across the system one of the local lock managers also acts as a master daemon, recording all locks currently in use and all outstanding LOCK requests. Before granting a lock to an application each local lock manager clears the request with the master lock manager. It does this by firstly sending a TRYLOCK message to the master, and following it up if the lock isn't granted by a LOCK message. The local lock manager times the TRYLOCK message in case the master lock manager has failed. When a master lock manager fails, the first local lock manager to detect this will call an election for a new master YOUR ARE NOT REQUIRED TO DESIGN AND IMPLEMENTLOGIC FOR THE ELECTION PROCEDURE, NOR YOU ARE REQUIRED TOPROVIDE LOGIC FOR WHEN A LOCAL LOCK MANAGER IS ELECTED AS A MASTER such procedures are to be represented by stubs where necessary. However, each local lock manager must keep a record of locks granted and lock requests outstanding to/from local applications so it can advise the new master lock manager and thereby reestablish global lock status. You are required to design, implement and test logic for the local lock manager apart from the exceptions noted above, and as further specified in the following notes. PLEASE REFER TO THE ATTACHED FILES FOR NOTES AND FORMAT OF THE DOCUMENTATION
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2)PSUDO-CODE MUST BE DELIVERIED 3)MUST BE DELEIVERED BY 25TH/MAY/2003 4)MUST FINSIH DOCUMENTATION ACCORDING TO FILES ATTACHED 5) MUST COMPILE AND RUN UNDER UNIX ENVIRONEMTN 6) MUST BE WRITTEN IS C LANGUAGE
## Platform
UNIX