Deadlock Detection and Avoidance in Static Step Topology under Distributed Environment

During the past years, the distributed computing approach has become very popular due to various advantages over centralized approach. In the distributed approach, the execution of a process has reduced and also it requires low cost for installation. Many of the researchers are using the modeling approach for solution of the software and hardware architecture research problems. The most popular approach of modeling is known as Unified Modeling Language based on the object-oriented technology. In the present work, a method of deadlock detection is explained for the newly proposed static step topology for the distributed network. In the step topology, the processes are taken as a task, sub task, macro, subroutine, etc which are executed in reflexive and symmetric manners when the systems are interconnected to each other under distributed environment and avoidance technique is also presented for the same. The deadlock detection technique is presented through a UML class model.


Introduction
In the current scenario, many of the software companies are changing the layout of computing labs from the old centralized computing approach towards the distributed computing approach as it involves low cost and saves the execution time of the tasks.Another advantage is that distributed computing system does not share the global clock.In the centralized approach, computing time of the tasks is much more in comparison of the distributed approach as the deadlock occurs frequently in the centralized approach.In the distributed computing approach deadlock situation can be handled by the use of mutual exclusion i.e. synchronization of the tasks.The present work is based upon a distributed kind of network connected through the static step topology designed by the authors; deadlock situations are detected and methods for avoidance of these situations are elaborated.In the present work, a static step topology is used for the high speed National Knowledge Network (NKN) connectivity and deadlock detection technique is defined for the execution of the processes/tasks or one transmits the information in terms of files from one device to another device attached through the topology.A method of avoidance is also explained.On the another aspects, modeling is necessary before executing the research problems as it saves the time and errors can be detected at the early stages of the software development, therefore, in the current scenario, many of the researchers are using the ob-ject-oriented Unified Modeling Language to construct the various models for the solution of the research problems, therefore, in the present work UML class model is also designed for finding the conditions of deadlock and a procedure to minimize the deadlock situations occurring in the distributed environment.

Related Work
In the current scenario and due to evolution of high speed network connectivity, many of the researchers share the information at the remote by using the remote login or transferring the information over the distributed network.Sharing of information in form of files, data, audio, video as well as mutual exclusion of tasks are well explained in [1].The static interconnection of the network plays an important role for sharing the files and it is known as the topology and an important reference Tanenbaum [2] has described various types of topologies used to intercomnect the devices under distributed computing environment.Various kinds of topologies like centralized, decentralized and hybrid, which are used for modeling, and internetworking of distributed systems are explained in [3].Another important reference is Hwang [4] which describes all the aspects related to the software and hardware architecture including the parameters affecting the execution of the processes under the distributed computing environment.Due to evolution of the windows programming, the tasks called as processes are synchronized when executed on the devices and obviously deadlock will occur according to the conditions of deadlock and these are well described by Milenkovic [5] and it consists of necessary conditions for deadlock as well as avoidance, prevention and detection of deadlock under distributed computing environment.For execution of the processes under distributed environment, mutual exclusion takes place and processes are executed according to the clock of the device and one of the important references is Lamports [6] which has explained the execution of processes under distributed environment using time, clock and ordering of events.Later on Ricart and Agrawala [7] have modified the Lamport's algorithm.Symmetric execution of processes using parallel operations is explained by Maekawa [8].Various Scientists have solved the problem of mutual exclusion for the distributed environment by taking the concepts of graphs, sets, etc.By the use of set theory, it is solved by Agrawal [9].Suzuki and Kasami [10] have described a token-based ring algorithm for execution of processes.
Modeling plays an important role for the solution of the research problem.Many of the researchers have used the latest modeling language known as Unified Modeling Language (UML) based on the object-oriented technology to solve the software and hardware architecture problems.First time in the literature, Unified Modeling Language for solution of the hardware architecture problem is proposed by Gomma [11] for designing the concurrent, distributed, and real-time applications with UML.Later on Pllana and Fahringer [12,13] have suggested profiles for modeling of distributed and parallel applications by using UML.Let us describe some of the important references based on the present aspects.Saxena and Arora [14] have proposed UML modeling of a protocol for establishing mutual exclusion in the distributed system.Recently, Saxena and Zaidi [15] have proposed a new topology called as static step topology for interconnection of systems under distributed environment.Then, UML Modeling of newly developed static topology called as step topology is done by Saxena and Zaidi [16] and also compared with the well known bus topology.Saxena and Zaidi [17] have also studied objective and impact of NKN project as well as advantages, disadvantages and difficulty faced by this project.A case study has also been done by authors to compute percentage utilization of NKN over the step topology.The authors [18] have also modified the Lamport's algorithm for the step topology for execution of processes in reflexive and symmetric manners.

Distributed System
A distributed system is an autonomous collection of computer systems, which connects the resources and users through message passing technique.It provides transparency, openness, reliability, scalability to the devices connected and also allows data sharing, resource sharing, audio and video sharing and reduces the cost of infrastructure.A representation of devices under distributed environment is shown in Figure 1.

A Process/Task
A Process as shown in Figure 2 is defined as tasks, subtasks, macro, subroutine, and a computer program running concurrently with other programs executed by using processor.Process Execution Controller (PEC) i.e. proc-essing_unit is fully responsible to execute the processes/ tasks.A UML class diagram of process is represented below with attributes and methods.

Deadlock
In operating system, deadlock is defined as a condition in  which two or more processes are competing for resources and each waits for other to finish its task and thus deadlock occurs.It arises because one process is requesting for resources which is already taken by another waiting process and which in turn is requesting for resource that is held by another waiting process.It is a common problem occurs in distributed system.The necessary and sufficient conditions of deadlock [5] are given below: 1) Mutual Exclusion-only one process is allowed to use the resources at one time; other processes are put in the suspended queue; 2) Hold and Wait-a process is requesting for resources which is held by another process; 3) No Preemption-the resources which are held by one process can not release if it is being used by other process; 4) Circular Wait-a process is waiting for resources held by another process which is already waiting for resource by another process, a cycle formed and deadlock occur.

UML Modeling for Deadlock Detection
On the basis of above aspects, a static step topology as shown in the Figure 3 is considered in which one step consists of three nodes and processes can share the resources by message passing technique.
In the above Figure N 1 , N 2 , …, N M show the devices which are arranged as per the step.The detailed description of the topology can be found in [15].In this figure, devices are attached on high speed NKN network connectivity.The speed of data transfer from one device to another device is 1 Gbps which can be extended up to 10 Gbps.
For detecting the deadlock conditions in the step topology over NKN network, a general UML class model is proposed in Figure 4 which shows the static behavior of the problem in which attributes and operations are grouped together to form a class.The figure represents the class diagram for deadlock condition, the processes are executed by assigning threads controlled by Thread class, then the process enters into the PEC through a class named as Ready_queue; resources are allocated to each process, if the PEC is busy and resources are not allocated then the processes have to wait in the suspended queue controlled by Suspended_queue class; if any process waits for a long time for resources after sometime, time out condition occurs and either older process will die or rollback and then finally deadlock is removed and then process is synchronized and enters into PEC which is responsible for execution of the process and after being executed the resultant sends back to the memory controlled by Memory class.

Deadlock Detection and Avoidance
On the basis of the above UML class model, the following cases arise on the NKN network in which devices are connected through static step topology as shown the Figure 3: Case 1: Reflexive Situation of Deadlock This situation of deadlock arises on the single node.Let us consider a single node N 1 as shown in Figure 3, when a process P1 on node N 1 needs resources which are executing on other nodes then the process P1 and other processes in queue on N 1 will become in the deadlock situation.This situation is represented as reflexive situation and the avoidance method from deadlock is given below: Avoidance: The reflexive situation of the deadlock can be avoided through the mutual exclusion of the processes in which resources are allocated to the processes as per the incoming request of the resources then at a time only one process can execute inside the critical section and after finishing the execution of process resources are released and next process will enter inside the critical section then in this situation no deadlock will occur.Processes synchronization will occur inside the critical section.
Case 2: Symmetric Situation of Deadlock The symmetric situation of deadlock arises when two nodes N 1 and N 2 are participating for execution of the processes and connected under step topology as shown in Figure 3 and they communicate through message passing technique, then following two cases arise: 1) When multiple processes are going to execute on node N 1 as per the scheduling algorithm then if resources are allocated to the younger processes then older processes which are waiting from a long time for resources will die and deadlock will occur.
2) If the process on the either node N 1 or N 2 will wait for a long time for resources then the processes will die (time out) due to wait and die condition after some time and deadlock will occur.
Avoidance: In the first case, the deadlock situation can be handled by making a priority queue of the processes.If the older processes are rolled back by giving priority over younger processes then deadlock can be avoided.
In the second case, if the resources are available, resources which are allocated and resources which will be released by other processes are known to the other processes which are trying to execute on either N 1 or N 2 and they communicate about the resources as said above through message passing technique, then deadlock will not occur.

Conclusion and Future Scope of Work
From the above it is concluded that the Unified Modeling Language (UML) is used to construct a model for the deadlock situation occurring in the static step topology.Two cases in the form of reflexive and symmetric deadlock are discussed and corresponding avoidance methods are explained.The present work can be extended for validation of the proposed UML model through Markov chain or Finite State methods.