Modeling and Verification of a Dynamic Information Structure Distributed Mutual Exclusion Algorithm Using Spin Prof. Virender Ranga 1 Department of Computer Engineering National Institute of Technology, Kurukshetra, India virender.ranga@nitkkr.ac.in Prof. Mohit Dua 2 Department of Computer Engineering National Institute of Technology, Kurukshetra, India er.mohitdua@gmail.com Abstract - In a distributed system, mutual exclusion is a condition which ensures that a shared resource in the system can be accessed by one and only one process at a time. Mutual exclusion ensures that only one process can be in its critical section at a time. Many distributed mutual exclusion algorithms have been proposed and verified [1][2][3][4][5]. In this paper, we have modeled and verified the dynamic information-structure mutual exclusion algorithm for distributed systems [1] using SPIN as the model checker. The algorithm is modeled in the Promela language which is interpreted using SPIN and the sequence diagrams corresponding to the model generated by SPIN are used to verify the correctness of the model. Keywords Promela; Spin Checker I. INTRODUCTION In the systems involving multiple processes, when a process has to read or update certain shared data structures, it first enters a critical region to achieve mutual exclusion and ensures that no other process will use the shared data structures at the same time. The mutual exclusion problem states that only a single process can be allowed access to a protected resource, also termed as a critical section (CS), at any time. Mutual exclusion is a form of synchronization and is one of the most fundamental paradigms in computing systems. A good distributed mutual exclusion algorithm must meet following requirements: 1. Safety: At any instant, only one process can execute the critical section. 2. Progress: This property states the absence of deadlock and starvation. Two or more sites should not endlessly wait for messages which will never arrive. In addition, a site must not wait indefinitely to execute the CS while other sites are repeatedly executing the CS. That is, every requesting site should get an opportunity to execute the CS in finite time. 3. Fairness: Each process gets a fair chance to execute the CS. Fairness property generally means the CS execution requests are executed in the order of their arrival (time is determined by a logical clock) in the system. In this paper, we have discussed the Singhal’s Dynamic Information Structure Distributed Mutual Exclusion Algorithm and its modeling in the ProMeLa and verified using the SPIN model checker. II. THE SPIN MODEL CHECKER The Spin model checker [6] is a powerful, but lightweight analysis tool that has been used to model and verify both hardware and software systems. Originally developed to model computer and network protocols, the adoption of Spin has found its way into many application domains [6][7][8][9][10][11][12] [13]. One of the novelties of Spin is its relatively simple specification language, Promela. [7] SPIN [6] is a tool for analyzing the logical consistency of concurrent systems, specifically of data communication protocols. The system is described in a modeling language called PROMELA (Process Meta Language). PROMELA is a verification modeling language. It provides a vehicle for making abstractions of protocols (or distributed systems in general) that suppress details that are unrelated to process interaction. It also allows for the dynamic creation of concurrent processes. Communication via message channels can be defined to be synchronous (i.e., rendezvous), asynchronous (i.e., buffered). Given a model system specified in Promela, Spin performs random simulations of the system's execution. During simulation and verification Spin checks for the absence of deadlocks, unspecified receptions, and unexecutable code. The verifier can also be used to verify the correctness of system invariants, it can find non-progress execution cycles, and it can verify correctness properties expressed in next-time free linear temporal logic formulae.