Top Banner
Roll No:____ Name:__________________ Sem:_______Section______ Distributed Operating System Lab Manual
44

Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Feb 08, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Roll No:____

Name:__________________

Sem:_______Section______

Distributed Operating System Lab Manual

Page 2: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 1

Distributed Operating System Lab Manual 2019

CERTIFICATE

Certified that this file is submitted by

Shri/Ku.___________________________________________________________

Roll No.________a student of ________ year of the course __________________

______________________________________ as a part of PRACTICAL/ORAL as

prescribed by the Rashtrasant Tukadoji Maharaj Nagpur University for the

subject_____________________________________ in the laboratory of

___________________________________during the academic year

_________________________ and that I have instructed him/her for the said work,

from time to time and I found him/her to be satisfactory progressive.

And that I have accessed the said work and I am satisfied that the same is up to that

standard envisaged for the course.

Date:- Signature & Name Signature & Name

of Subject Teacher of HOD

Page 3: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 2

Distributed Operating System Lab Manual 2019

Anjuman College of Engineering and Technology Vision

To be a centre of excellence for developing quality technocrats with moral and social

ethics, to face the global challenges for the sustainable development of society.

Mission

To create conducive academic culture for learning and identifying career goals.

To provide quality technical education, research opportunities and imbibe

entrepreneurship skills contributing to the socio-economic growth of the Nation.

To inculcate values and skills, that will empower our students towards development

through technology.

Vision and Mission of the Department

Vision:

To achieve excellent standards of quality education in the field of computer science

and engineering, aiming towards development of ethically strong technical experts

contributing to the profession in the global society.

Mission:

To create outcome based education environment for learning and identifying career

goals.

Provide latest tools in a learning ambience to enhance innovations, problem solving

skills, leadership qualities team spirit and ethical responsibilities.

Inculcating awareness through innovative activities in the emerging areas of

technology.

Page 4: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 3

Distributed Operating System Lab Manual 2019

Program Educational Objectives (PEOs)

The graduates will have a strong foundation in mathematical, scientific and

engineering fundamentals necessary to formulate, solve and analyze engineering

problem in their career.

Graduates will be able to create and design computer support systems and impart

knowledge and skills to analyze, design, test and implement various software

applications.

Graduates will work productively as computer science engineers towards betterment

of society exhibiting ethical qualities.

Program Specific Outcomes (PSOs)

Foundation of mathematical concepts: To use mathematical methodologies and

techniques for computing and solving problem using suitable mathematical analysis,

data structures, database and algorithms as per the requirement.

Foundation of Computer System: The capability and ability to interpret and

understand the fundamental concepts and methodology of computer systems and

programming. Students can understand the functionality of hardware and software

aspects of computer systems, networks and security.

Foundations of Software development: The ability to grasp the software development

lifecycle and methodologies of software system and project development.

Page 5: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 4

Distributed Operating System Lab Manual 2019

PROGRAM: CSE DEGREE: B.E

COURSE: Distributed Operating System SEMESTER: VIII CREDITS: 2

COURSE CODE: BECSE406T COURSE TYPE: REGULAR

COURSE AREA/DOMAIN: Operating System

and Computer Network

CONTACT HOURS: 2 hours/Week.

CORRESPONDING LAB COURSE CODE :

BECSE406P

LAB COURSE NAME : Distributed Operating

System Lab

COURSE PRE-REQUISITES:

C.CODE COURSE NAME DESCRIPTION SEM

BECSE T Operating System Basic Concepts of Operating System V

Computer Network Basic Concepts of computer network

LAB COURSE OBJECTIVES:

This course explains the concept of distributed computing.

Develop distributed application using concept of multithreading, client-server and RMI.

Learn to solve problem of mutual exclusion and deadlock detection under distributed

environment.

How to use distributed file system and distributed shared memory effectively

Learn to handle failure and recovery under distributed environment

COURSE OUTCOMES: Design Patterns

After completion of this course the students will be able -

SNO DESCRIPTION BLOOM’S

TAXONOMY

LEVEL

CO406P.1 Understand concept of distributed computing and Construct distributed

application using concept of client-server & RMI

LEVEL 2

CO406P.2 Develop distributed application using concept of multithreading LEVEL 5

CO406P.3 Build the program to demonstrate concept of distributed mutual exclusion and

process synchronization.

LEVEL 5

CO406P.4 Construct the program to demonstrate concept of centralized and distributed

deadlock.

LEVEL 5

CO406P.5 Build distributed application to illustrate the concept of shared memory and fault

tolerance

LEVEL 5

Page 6: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 5

Distributed Operating System Lab Manual 2019

Lab Instructions:

Make entry in the Log Book as soon as you enter the Laboratory.

All the students should sit according to their Roll Numbers.

All the students are supposed to enter the terminal number in the Log Book.

Do not change the terminal on which you are working.

Strictly observe the instructions given by the Faculty / Lab. Instructor.

Take permission before entering in the lab and keep your belongings in the

racks.

NO FOOD, DRINK, IN ANY FORM is allowed in the lab.

TURN OFF CELL PHONES! If you need to use it, please keep it in bags.

Avoid all horseplay in the laboratory. Do not misbehave in the computer

laboratory. Work quietly.

Save often and keep your files organized.

Don’t change settings and surf safely.

Do not reboot, turn off, or move any workstation or PC.

Do not load any software on any lab computer (without prior permission of

Faculty and Technical Support Personnel). Only Lab Operators and Technical

Support Personnel are authorized to carry out these tasks.

Do not reconfigure the cabling/equipment without prior permission.

Do not play games on systems.

Turn off the machine once you are done using it.

Violation of the above rules and etiquette guidelines will result in disciplinary

action.

Page 7: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 6

Distributed Operating System Lab Manual 2019

Continuous Assessment Practical

Exp

No NAME OF EXPERIMENT Date Sign Remark

1 Construct chat application to demonstrate the concept of echo client

server application.

2 Construct program to illustrate concept of echo client server

application

3 Build an application that executes two threads. One thread display

“HELLO WOLD” every 1000 milliseconds and another thread

display “How Are You” every 2000 milliseconds.

4 Construct a program to demonstrate the concept of logical clock

synchronization in distributed environment using Lamport logical

clock.

5 Build a program to implement concept of distributed mutual

exclusion using Ricart-Agrawala Algorithm.

6 Study the concept of Token Based algorithm.

7 Build a program to illustrate the concept of distributed deadlock

detection using Edge Chasing deadlock detection algorithm

8 Design a distributed application using remote method invocation

where client submit two strings to server and returns concatenation

of given string.

9 Construct a program to implement two phase commit protocol.

10 Construct a program to read a content of file from server, where file

name given as input by client using shared memory.

Page 8: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 7

Distributed Operating System Lab Manual 2019

CONTENTS Exp

No NAME OF EXPERIMENT

PAGE

NO.

1 Construct chat application to demonstrate the concept of echo client server application.

2 Construct program to illustrate concept of echo client server application

3 Build an application that executes two threads. One thread display “HELLO WOLD” every

1000 milliseconds and another thread display “How Are You” every 2000 milliseconds.

4 Construct a program to demonstrate the concept of logical clock synchronization in

distributed environment using Lamport logical clock.

5 Build a program to implement concept of distributed mutual exclusion using Ricart-

Agrawala Algorithm.

6 Study the concept of Token Based algorithm.

7 Build a program to illustrate the concept of distributed deadlock detection using Edge

Chasing deadlock detection algorithm

8 Design a distributed application using remote method invocation where client submit two

strings to server and returns concatenation of given string.

9 Construct a program to implement two phase commit protocol.

10 Construct a program to read a content of file from server, where file name given as input by

client using shared memory.

Signature & Name

of Subject Teacher

Page 9: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 8

Distributed Operating System Lab Manual 2019

EXPERIMENT NO – 1

AIM: Study of Distributed Operating System

OBJECTIVES:

To Study the concept of Distributed Operating system.

Definition & Goal

Definition: “A distributed system is a collection of independent computers that appear to the users of

the system as a single computer”

Distributed Operating System is a model where distributed applications are running on multiple

computers linked by communications. A distributed operating system is an extension of the network

operating system that supports higher levels of communication and integration of the machines on

the network.

This system looks to its users like an ordinary centralized operating system but runs on multiple,

independent central processing units (CPUs).

Page 10: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 9

Distributed Operating System Lab Manual 2019

These systems are referred as loosely coupled systems where each processor has its own local

memory and processors communicate with one another through various communication lines, such

as high speed buses or telephone lines. By loosely coupled systems, we mean that such computers

possess no hardware connections at the CPU - memory bus level, but are connected by external

interfaces that run under the control of software.

The Distributed Os involves a collection of autonomous computer systems, capable of

communicating and cooperating with each other through a LAN / WAN. A Distributed Os provides a

virtual machine abstraction to its users and wide sharing of resources like as computational capacity,

I/O and files etc.

The structure shown in fig contains a set of individual computer systems and workstations connected

via communication systems, but by this structure we can not say it is a distributed system because it

is the software, not the hardware, that determines whether a system is distributed or not.

The users of a true distributed system should not know, on which machine their programs are

running and where their files are stored. LOCUS and MICROS are the best examples of distributed

operating systems.

Using LOCUS operating system it was possible to access local and distant files in uniform manner.

This feature enabled a user to log on any node of the network and to utilize the resources in a

network without the reference of his/her location. MICROS provided sharing of resources in an

automatic manner. The jobs were assigned to different nodes of the whole system to balance the load

on different nodes.

Why build a distributed system?

Microprocessors are getting more and more powerful.

A distributed system combines (and increases) the computing power of individual

computer.

Some advantages include:

o Resource sharing

(but not as easily as if on the same machine)

o Enhanced performance

(but 2 machines are not as good as a single machine that is 2 times as fast)

o Improved reliability & availability

(but probability of single failure increases, as does difficulty of recovery)

o Modular expandability

Distributed OS's have not been economically successful!!!

System models:

the minicomputer model (several minicomputers with each computer supporting

multiple users and providing access to remote resources).

the workstation model (each user has a workstation, the system provides some

common services, such as a distributed file system).

the processor pool model (the model allocates processor to a user according to the

user's needs).

Page 11: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 10

Distributed Operating System Lab Manual 2019

Where is the knowledge of distributed operating systems likely to be useful?

custom OS's for high performance computer systems

OS subsystems, like NFS, NIS

distributed ``middleware'' for large computations

distributed applications

Issues in Distributed Systems

the lack of global knowledge

naming

scalability

compatibility

process synchronization (requires global knowledge)

resource management (requires global knowledge)

security

fault tolerance, error recovery

Lack of Global Knowledge

Communication delays are at the core of the problem

Information may become false before it can be acted upon

these create some fundamental problems:

o no global clock -- scheduling based on fifo queue?

o no global state -- what is the state of a task? What is a correct program?

Naming

named objects: computers, users, files, printers, services

namespace must be large

unique (or at least unambiguous) names are needed

logical to physical mapping needed

mapping must be changeable, expandable, reliable, fast

Scalability

How large is the system designed for?

How does increasing number of hosts affect overhead?

broadcasting primitives, directories stored at every computer -- these design

options will not work for large systems.

Page 12: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 11

Distributed Operating System Lab Manual 2019

Compatibility

Binary level: same architecture (object code)

Execution level: same source code can be compiled and executed (source code).

Protocol level: only requires all system components to support a common set of

protocols.

Process synchronization

test-and-set instruction won't work.

Need all new synchronization mechanisms for distributed systems.

Distributed Resource Management

Data migration: data are brought to the location that needs them.

o distributed filesystem (file migration)

o distributed shared memory (page migration)

Computation migration: the computation migrates to another location.

o remote procedure call: computation is done at the remote machine.

o processes migration: processes are transferred to other processors.

Security

Authetication: guaranteeing that an entity is what it claims to be.

Authorization: deciding what privileges an entity has and making only those privileges

available.

Below given are some of the examples of distributed operating systems:

l. IRIX operating system; is the implementation of UNIX System V, Release 3 for Silicon Graphics

multiprocessor workstations.

2. DYNIX operating system running on Sequent Symmetry multiprocessor computers.

3. AIX operating system for IBM RS/6000 computers.

4. Solaris operating system for SUN multiprocessor workstations.

5. Mach/OS is a multithreading and multitasking UNIX compatible operating system;

6. OSF/1 operating system developed by Open Foundation Software: UNIX compatible.

Distributed systems provide the following advantages:

1 Sharing of resources.

2 Reliability.

3 Communication.

Page 13: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 12

Distributed Operating System Lab Manual 2019

4 Computation speedup

Distributed systems are potentially more reliable than a central system because if a system has only

one instance of some critical component, such as a CPU, disk, or network interface, and that

component fails, the system will go down. When there are multiple instances, the system may be

able to continue in spite of occasional failures. In addition to hardware failures, one can also consider

software failures. Distributed systems allow both hardware and software errors to be dealt with.

A distributed system is a set of computers that communicate and collaborate each other using

software and hardware interconnecting components. Multiprocessors (MIMD computers using

shared memory architecture), multicomputers connected through static or dynamic interconnection

networks (MIMD computers using message passing architecture) and workstations connected

through local area network are examples of such distributed systems.

A distributed system is managed by a distributed operating system. A distributed operating system

manages the system shared resources used by multiple processes, the process scheduling activity

(how processes are allocating on available processors), the communication and synchronization

between running processes and so on. The software for parallel computers could be also tightly

coupled or loosely coupled. The loosely coupled software allows computers and users of a

distributed system to be independent each other but having a limited possibility to cooperate. An

example of such a system is a group of computers connected through a local network. Every

computer has its own memory, hard disk. There are some shared resources such files and printers. If

the interconnection network broke down, individual computers could be used but without some

features like printing to a non-local printer.

References :

Advanced Concepts in Operating Systems, Mukesh Singhal and Niranjan Shivaratri, Tata

McGraw Hill, 2001.

Lab Manual of Institute Of Information Technology & Management Gwalior.

www.nptel.ac.in/courses/106106107

Lab Manual of SGGS Institute of Engineering and Technology, Nanded.

https://books.google.co.in/books?id=nel4vdeLcqkC&printsec=frontcover&source=gbs_ge_summar

y_r&cad=0#v=onepage&q&f=false

Page 14: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 13

Distributed Operating System Lab Manual 2019

Viva Voce Questions

1. Define Distributed Operating system?

________________________________________________________________

________________________________________________________________

2. What are the major designing issues in Distributed Operating system?

________________________________________________________________

________________________________________________________________

3. What are advantages and disadvantages of Distributed Operating system?

________________________________________________________________

________________________________________________________________

________________________________________________________________

Signature of Subject Teacher

Page 15: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 14

Distributed Operating System Lab Manual 2019

EXPERIMENT NO – 2

AIM: Construct echo chat application to demonstrate the concept of client server application.

OBJECTIVES:

To know the concept of client server.

To interpret the process of how communication between client and server is established.

To know the concept of socket programming in distributed environment.

THEORY/ALGORITHM:

The client-server model is one of the most used communication paradigms in networked

systems. The server accepts the connection from the client, binds a new socket to the same local port,

and sets its remote endpoint to the client's address and port. It needs a new socket so that it can

continue to listen to the original socket for connection requests when the attention needs for the

connected client.

Creating a server program:

The EchoServer example creates a server socket and waits for a client request. When it receives a

client request, the server connects to the client and responds to it.

Following are the steps to create echo server application

Create and open a server socket.

ServerSocket serverSocket = new ServerSocket(portNumber);

The portNumber argument is the logical address through which the application communicates over

the network. It's the port on which the server is running. You must provide the port number through

which the server can listen to the client. Don't select port numbers between 0 and 1,023 because

they're reserved for privileged users (that is, super user or root). Add the server socket inside the try-

with-resources block.

Wait for the client request.

Socket clientSocket = serverSocket.accept();

The accept() method waits until a client starts and requests a connection on the host and port of this

server. When a connection is requested and successfully established, the accept()method returns a

new Socket object. It's bound to the same local port, and its remote address and remote port are set to

Page 16: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 15

Distributed Operating System Lab Manual 2019

match the client's. The server can communicate with the client over this new object and listen for

client connection requests.

Open an input stream and an output stream to the client.

out = new PrintWriter(clientSocket.getOutputStream(), true);

in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));

Communicate with the client.

Receive data from the client: (inputLine = in.readLine())

Send data to the client: out.println(inputLine);

Close the streams and then close the socket.

Creating a client program:

The client knows the host name of the machine on which the server is running. It also knows the port

number on which the server is listening. To make a connection request, the client tries to connect

with the server on the server's machine and port. Because the client also needs to identify itself to the

server, it binds to a local port number that it will use during this connection. The system typically

assigns the port number.

Following are the various steps to create client.

Create and open a client socket.

Socket echoSocket = new Socket(hostName, portNumber);

The hostName argument is the machine where you are trying to open a connection, and portNumber

is the port on which the server is running. Don't select port numbers between 0 and 1,023 because

they're reserved for privileged users (that is, super user or root).

Open an input stream and an output stream to the socket.

PrintWriter out = new PrintWriter(echoSocket.getOutputStream(), true);

BufferedReader in = new BufferedReader(new InputStreamReader(echoSocket.getInputStream()));

Read from and write to the stream according to the server's protocol.

Receive data from the server: (userInput = stdIn.readLine())

Page 17: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 16

Distributed Operating System Lab Manual 2019

Send data to the server: out.println(userInput);

Close the streams and then close the socket.

CODE: ( Attach Printout)

OUTPUT: ( Attach Printout)

CONCLUSION:

REFERENCE:

Advanced Concepts in Operating Systems, Mukesh Singhal and Niranjan Shivaratri, Tata McGraw

Hill, 2001.

Lab Manual of Institute Of Information Technology & Management Gwalior.

www.nptel.ac.in/courses/106106107

Lab Manual of SGGS Institute of Engineering and Technology, Nanded.

https://www.javatpoint.com/socket-programming

Page 18: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 17

Distributed Operating System Lab Manual 2019

Viva Voce Questions

1. Explain Client Server model?

________________________________________________________________

________________________________________________________________

2. Explain the logic to implement client server model?

________________________________________________________________

________________________________________________________________

3. Where client server model is required?

________________________________________________________________

________________________________________________________________

________________________________________________________________

Signature of Subject Teacher

Page 19: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 18

Distributed Operating System Lab Manual 2019

EXPERIMENT NO – 3

AIM: Build an application to illustrate the concept of multi threading

PROBLEM : Build an application that executes two threads. One thread display “HELLO WOLD”

every 1000 milliseconds and another thread display “How Are You” every 2000 milliseconds.

OBJECTIVES:

To Study concept of multithreading.

To create the concurrent execution for multiple queries at a time.

THEORY/ALGORITHM:

Multithreading in java is a process of executing multiple threads simultaneously. Thread is basically

a lightweight sub-process, a smallest unit of processing. Multiprocessing and multithreading, both

are used to achieve multitasking.

Life Cycle of a Thread:

Following figure shows the variuos stages of thread also called as life cycle of thread.

Figure: Lifecycle of thread

A thread goes through various stages in its life cycle. For example, a thread is born, started, runs, and

then dies. Following diagram shows complete life cycle of a thread.

New: A new thread begins its life cycle in the new state. It remains in this state until the program

starts the thread. It is also referred to as a born thread.

Runnable:After a newly born thread is started, the thread becomes runnable. A thread in this state

Page 20: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 19

Distributed Operating System Lab Manual 2019

is considered to be executing its task.

Waiting:Sometimes, a thread transitions to the waiting state while the thread waits for another

thread to perform a task.A thread transitions back to the runnable state only when another thread

signals the waiting thread to continue executing.

Timed waiting:A runnable thread can enter the timed waiting state for a specified interval of time.

A thread in this state transitions back to the runnable state when that time interval expires or when

the event it is waiting for occurs.

Terminated:A runnable thread enters the terminated state when it completes its task or otherwise

terminates.

Thread Priorities:

Every Java thread has a priority that helps the operating system determine the order in which

threads are scheduled.

Java thread priorities are in the range between MIN_PRIORITY (a constant of 1) and

MAX_PRIORITY (a constant of 10). By default, every thread is given priority NORM_PRIORITY

(a constant of 5).

Threads with higher priority are more important to a program and should be allocated processor

time before lower-priority threads. However, thread priorities cannot guarantee the order in which

threads execute and very much platform dependentant.

CODE: ( Attach Printout)

OUTPUT: ( Attach Printout)

CONCLUSION:

REFERENCE:

Advanced Concepts in Operating Systems, Mukesh Singhal and Niranjan Shivaratri, Tata McGraw

Hill, 2001.

Lab Manual of Institute Of Information Technology & Management Gwalior.

http://nptel.ac.in/courses/106105033/37.

https://www.javatpoint.com/multithreading-in-java

Page 21: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 20

Distributed Operating System Lab Manual 2019

Viva Voce Questions

1. What is thread? Also Explain Multithreading.

________________________________________________________________

________________________________________________________________

2. Explain the logic to implement multi threading?

________________________________________________________________

________________________________________________________________

3. Explain life cycle of multithreading?

________________________________________________________________

________________________________________________________________

________________________________________________________________

Signature of Subject Teacher

Page 22: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 21

Distributed Operating System Lab Manual 2019

EXPERIMENT NO – 4

AIM: Build a program to demonstrate the concept of logical clock.

PROBLEM: Construct a program to demonstrate the concept of logical clock. synchronization in

distributed environment using Lamport logical clock.

OBJECTIVES:

To know the concept of logical clock.

To study the need of logical clock.

To study clock synchronization issues in distributed environment.

THEORY/ALGORITHM:

Distributed system is a collection of computer that are interconnected via some

communication networks. Basically all the computers in distributed system are physically separated

and they may be located apart from each other. Therefore all the process that interact with each other

need to be synchronized in the context of time to achieve some goal.

There are certain limitations of distributed systems that leave impact on the diesign of distributed

systems

Following are some inherent limitations :

No global clock available

No shared Memory

In distributed system, there is no common or global clock available. Since in some situation, the

programs on different computers need to coordinate their actions by exchanging message. Due to the

unavailability of notion of a global clock there are limits on the accuracy of the output. Fo that

purpose temporal ordering of events is required for scheduling processes and it becomes very

difficult for a distributed system.

In case of ordering events according to time, Lamport proposed a scheme using logical clocks.

Lamport’s Clock:

Logical time and logical clocks:

A logical clock is a monotonically increasing software counter. It need not relate to a physical

clock.

Each process pi has a logical clock, Li which can be used to apply logical timestamps to events.

LC1: Li is incremented by 1 before each event at process pi

LC2:

Page 23: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 22

Distributed Operating System Lab Manual 2019

(a) when process pi sends message m, it piggybacks t = Li

(b) when pj receives (m,t) it sets Lj := max(Lj, t) and applies LC1 before times tamping the event

receive (m)

CODE: ( Attach Printout)

OUTPUT: ( Attach Printout)

CONCLUSION:

REFERENCE:

Advanced Concepts in Operating Systems, Mukesh Singhal and Niranjan Shivaratri, Tata McGraw

Hill, 2001.

Lab Manual of Institute Of Information Technology & Management Gwalior.

www.nptel.ac.in/courses/106106107/Module-4—ClockSynchronization.

Page 24: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 23

Distributed Operating System Lab Manual 2019

Viva Voce Questions

1. What is Logical Clock? Explain it.

________________________________________________________________

________________________________________________________________

2. What is necessity of Logical Clock?

________________________________________________________________

________________________________________________________________

3. What are the limitations of Lamport’s Logical Clock.

________________________________________________________________

________________________________________________________________

________________________________________________________________

Signature of Subject Teacher

Page 25: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 24

Distributed Operating System Lab Manual 2019

EXPERIMENT NO – 5

AIM: Build a program to implement Ricart – Agrawala Algorithm

OBJECTIVES:

To Study the concept of mutual exclusion in distributed environment.

To study the working of Ricart-Agrawala algorithm

THEORY/ALGORITHM:

Mutual exclusion:

Concurrent access of processes to a shared resource or data is executed in mutually exclusive

manner.

Only one process is allowed to execute the critical section (CS) at any given time.

In a distributed system, shared variables (semaphores) or a local kernel cannot be used to

implement mutual exclusion.

Three basic approaches for distributed mutual exclusion:

1. Token based approach

2. Non-token based approach

3. Quorum based approach

1. Token-based approach:

A unique token is shared among the sites.

A site is allowed to enter its CS if it possesses the token.

Mutual exclusion is ensured because the token is unique

2. Non-token based approach:

Two or more successive rounds of messages are exchanged among the sites to determine which site

will enter the CS next.

3. Quorum based approach:

Each site requests permission to execute the CS from a subset of sites (called a quorum).

Any two quorums contain a common site.

This common site is responsible to make sure that only one request executes the CS at any time

Ricart-Agrawala Algorithm

Optimization of Lamport’s – no releases (merged with replys)

Requesting the critical section (CS):

Page 26: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 25

Distributed Operating System Lab Manual 2019

When a processor wants to enter the CS, it:

Sends a timestamped request to all OTHER processors

When a processor receives a request:

If it is neither requesting nor executing the CS, it returns a reply(not timestamped)

If it is requesting the CS, but the timestamp on the incoming request is smaller than

the timestamp on its own request, it returns a reply Means the other processor

requested first Otherwise, it defers answering the request.

Executing the CS:

A processor enters the CS when:

It has received a reply from all other processors in the system

Releasing the CS:

When a process leaves the CS, it:

Sends a reply message to all the deferred requests (process with next earliest request

will now received its last reply message and enter the CS)

Evaluation:

message complexity - 2(N–1)

(N–1) reply, (N–1) request

synchronization delay – 1 T

CODE: ( Attach Printout)

OUTPUT: ( Attach Printout)

CONCLUSION:

REFERENCE:

Advanced Concepts in Operating Systems, Mukesh Singhal and Niranjan Shivaratri, Tata McGraw

Hill, 2001.

Lab Manual of Institute Of Information Technology & Management Gwalior.

Page 27: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 26

Distributed Operating System Lab Manual 2019

Viva Voce Questions

1. What is Mutual Exclusion in distributed operating system?

________________________________________________________________

________________________________________________________________

2. Differentiate between Non-Token Based and Token Based algorithm?

________________________________________________________________

________________________________________________________________

3. Explain the Logic of Ricart-Agrawala algorithm.

________________________________________________________________

________________________________________________________________

________________________________________________________________

Signature of Subject Teacher

Page 28: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 27

Distributed Operating System Lab Manual 2019

EXPERIMENT NO – 6

Aim: Study the concept of Token Based algorithm.

INLAB AIM : Study Token Based algorithm.

OBJECTIVES:

To Study the concept of mutual exclusion in distributed environment.

To study the working of Suzuki Kasami's algorithm

THEORY/ALGORITHM:

Mutual exclusion:

Concurrent access of processes to a shared resource or data is executed in mutually exclusive

manner.

Only one process is allowed to execute the critical section (CS) at any given time.

In a distributed system, shared variables (semaphores) or a local kernel cannot be used to

implement mutual exclusion.

Three basic approaches for distributed mutual exclusion:

1. Token based approach

2. Non-token based approach

3. Quorum based approach

1. Token-based approach:

A unique token is shared among the sites.

A site is allowed to enter its CS if it possesses the token.

Mutual exclusion is ensured because the token is unique

2. Non-token based approach:

Two or more successive rounds of messages are exchanged among the sites to determine which site

will enter the CS next.

3. Quorum based approach:

Each site requests permission to execute the CS from a subset of sites (called a quorum).

Any two quorums contain a common site.

This common site is responsible to make sure that only one request executes the CS at any time

Suzuki Kasami’s broadcast algorithm

Page 29: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 28

Distributed Operating System Lab Manual 2019

Suzuki Kasami is token based mutual exclusion algorithm which can be used to achieve

mutual exclusion in distibuted environmnet.

Overview:

If a process wants to enter the critical section, and it does not have the token, it broadcasts a

request message to all other processes in the system

The processes that has the token will then send it to the requesting process

However, if it is in CS, it gets to finish before sending the token

A process holding the token can continuously enter the critical section until the token is requested

Request vector at process i:

RNi[k] contains the largest sequence number received from process k in a request message

Token consists of vector and a queue:

LN[k] contains the sequence number of the latest executed request from process k

Q is the queue of requesting process

Requesting the critical section (CS):

When a process i wants to enter the CS, if it does not have the token, it:

- Increments its sequence number Rni[i].

-Sends a request message containing new sequence number to all processes in the system.

When a process k receives the request(i,sn) message, it:

- Sets RNk[i] to MAX(RNk[i], sn).

-If sn < Rnk[i], the message is outdated.

If process k has the token and is not in CS (i.e., is not using token), and if RNk[i] == LN[i]+1

(indicating an outstanding request) it sends the token to process i.

Executing the CS:

-A process enters the CS when it has acquired the token.

Releasing the CS:

When a process i leaves the CS, it:

-Sets LN[i] of the token equal to Rni[i].

-Indicates that its request RN i[i] has been executed.

For every process k whose ID is not in the token queue Q, it appends its ID to Q if Rni[ k] ==

LN[k]+1

-Indicates that process k has an outstanding request

If the token queue Q is nonempty after this update, it deletes the process ID at the head of Q and

sends the token to that process

-Gives priority to others’ requests

-Otherwise, it keeps the token

Evaluation:

0 to N messages required to enter CS

No messages if process holds the token

Otherwise N 1 requests, 1 reply

CONCLUSION:

Page 30: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 29

Distributed Operating System Lab Manual 2019

REFERENCE:

Advanced Concepts in Operating Systems, Mukesh Singhal and Niranjan Shivaratri, Tata McGraw

Hill, 2001.

Lab Manual of Institute Of Information Technology & Management Gwalior.

Viva Voce Questions

1. State how to analyze performance of mutual exclusion algorithm?

________________________________________________________________

________________________________________________________________

2. What is Quorum based approach of Token base algorithm in distributed

operating system?

________________________________________________________________

________________________________________________________________

3. Explain the Logic of Susuki ksami algorithm.

________________________________________________________________

________________________________________________________________

________________________________________________________________

Signature of Subject Teacher

EXPERIMENT NO – 7

Page 31: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 30

Distributed Operating System Lab Manual 2019

Aim: Build a program to illustrate the concept of distributed deadlock

detection

INLAB AIM : Build a program to implement Edge Chasing deadlock detection algorithm.

OBJECTIVES:

To know the concept of deadlock.

To interprete the concept of distributed deadlock.

To know the process of detecting deadlock.

THEORY/ALGORITHM:

A deadlock is a situation in which two computer programs sharing the same resource are

effectively preventing each other from accessing the resource, resulting in both programs ceasing to

function.

The same conditions for deadlock in uniprocessors apply to distributed systems.

Unfortunately, as in many other aspects of distributed systems, they are harder to detect, avoid, and

prevent.

Chandy-Misra-Haas’s distributed deadlock detection algorithm for AND model is based on

edge-chasing. The algorithm uses a special message called probe, which is a triplet (i, j, k), denoting

that it belongs to a deadlock detection initiated for process Pi and it is being sent by the home site of

process Pj to the home site of process Pk . A probe message travels along the edges of the global

TWF graph, and a deadlock is detected when a probe message returns to the process that initiated it.

A process Pj is said to be dependent on another process Pk if there exists a sequence of

processes Pj , Pi1, Pi2, …,Pim, Pk such that each process except Pk in the sequence is blocked and

each process, except the Pj , holds a resource for which the previous process in the sequence is

waiting. Process Pj is said to be locally dependent upon process Pk if Pj is dependent upon Pk and

both the processes are on the same site. Each process Pi maintains a boolean array, dependenti,

where dependent i (j) is true only if Pi knows that Pj is dependent on it. Initially, dependent i(j) is

false for all i and j.

Edge Chasing deadlock detection algorithm:

if Pi is locally dependent on itself

then declare a deadlock

else for all Pj and Pk such that

Page 32: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 31

Distributed Operating System Lab Manual 2019

1 Pi is locally dependent upon Pj , and

2 Pj is waiting on Pk , and

3 Pj and Pk are on different sites,send a probe (i, j, k) to the home site of Pk

On the receipt of a probe (i, j, k), the site takes the following actions:

if

1 Pk is blocked, and

2 dependentk (i) is false, and

3 Pk has not replied to all requests Pj

then

begin

dependent k (i) = true;

if k=i

then declare that Pi is deadlocked

else for all Pm and Pn such that

(a’) Pk is locally dependent upon Pm, and

(b’) Pm is waiting on Pn, and

(c’) Pm and Pn are on different sites, send a probe (i, m, n) to the home site of Pn

end.

CODE:

OUTPUT:

CONCLUSION:

REFERENCE:

Advanced Concepts in Operating Systems, Mukesh Singhal and Niranjan Shivaratri, Tata McGraw

Hill, 2001.

Lab Manual of Institute Of Information Technology & Management Gwalior.

www.nptel.ac.in/courses/106106107/Module-5--DistributedDeadlocks

Page 33: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 32

Distributed Operating System Lab Manual 2019

Viva Voce Questions

1. What do mean by distributed deadlock ?

________________________________________________________________

________________________________________________________________

2. What are the deadlock handling strategies in distributed system?

________________________________________________________________

________________________________________________________________

3. What are the issues in deadlock detection algorithm? Explain.

________________________________________________________________

________________________________________________________________

________________________________________________________________

Signature of Subject Teacher

Page 34: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 33

Distributed Operating System Lab Manual 2019

EXPERIMENT NO – 8

Aim: Implement a program to illustrate the concept of Remote Method

Invocation (RMI)

INLAB AIM : Design a distributed application using remote method invocation where client submit

two strings to server and returns concatenation of given string.

OBJECTIVES:

To study RMI concepts.

To know how to invoke a method running in different JVM.

To study how to write an application using RMI methodology.

THEORY/ALGORITHM:

The main objective of RMI is to provide the facility of invoking method on server. This is done by

creating a RMI Client and RMI Server. RMI Client invokes a method defined on the RMI Server. In

this article, we will learn:

RMI terminology:

Following figure shows the terminology of Remote Method Invocation.

Figure : Method is invoked by client on the server using RMI

RMI is used to communicate between two running java applications on different JVM (Java Virtual

Machines). The main motive behind RMI implementation is to invoke one method running on

different JVM. The JVM Application, in which an invoked method is running out, is called RMI

Server, where as the invoking application running on the different JVM is called RMI Client.

RMI Client: It is an object that invokes remote methods on an RMI Server.

Page 35: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 34

Distributed Operating System Lab Manual 2019

Stub: A stub is proxy that stands for RMI Server on client side and handles remote method

invocation on behalf of RMI Client.

Skeleton: It is a proxy that stands for RMI client on server side and handles remote method

invocation on RMI Server on behalf of client.

Registry Service: A Registry Service is an application that provides the facility of registration &

lookup of Remote stub.

A Registry Service provides location transparency of Remote Object to RMI Client.

Figure : Role of stub and skeleton in RMI

Algorithm:

Step 1: Define Remote Interface

A remote interface specifies the methods that can be invoked remotely by a client. Clients program

communicate to remote interfaces, not to classes implementing it. To be a remote interface, a

interface must extend the Remote interface of java.rmi package.

Step 2: Implementation of remote interface

For implementation of remote interface, a class must either extend UnicastRemoteObject or use

exportObject() method of UnicastRemoteObject class.

Step 3: Create AddServer and host rmi service

You need to create a server application and host rmi service Adder in it. This is done using rebind()

method of java.rmi.Naming class. rebind() method take two arguments, first represent the name of

the object reference and second argument is reference to instance of Adder

Step 4: Create client application

Client application contains a java program that invokes the lookup() method of the Naming class.

This method accepts one argument, the rmi URL and returns a reference to an object of type

AddServerInterface. All remote method invocation is done on this object.

Page 36: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 35

Distributed Operating System Lab Manual 2019

CODE:

OUTPUT:

CONCLUSION:

REFERENCE:

Advanced Concepts in Operating Systems, Mukesh Singhal and Niranjan Shivaratri, Tata McGraw

Hill, 2001.

Lab Manual of Institute Of Information Technology & Management Gwalior.

https://www.javatpoint.com/RMI.

Page 37: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 36

Distributed Operating System Lab Manual 2019

Viva Voce Questions

1. Explain RMI ?

________________________________________________________________

________________________________________________________________

2. What is JVM?

________________________________________________________________

________________________________________________________________

Signature of Subject Teacher

Page 38: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 37

Distributed Operating System Lab Manual 2019

EXPERIMENT NO – 9

Aim: Construct a program to implement commit protocol.

INLAB AIM : Construct a program to implement two phase commit protocol.

OBJECTIVES:

To know the concept of commit Protocol.

To interpret the role of two phase commit protocol in distributed application.

To recognize working of two phase commit protocol.

THEORY/ALGORITHM:

The two phase commit protocol is a distributed algorithm which lets all sites in a distributed

system agree to commit a transaction. The protocol results in either all nodes committing the

transaction or aborting, even in the case of site failures and message losses. However, due to the

work by Skeen and Stonebraker, the protocol will not handle more than one random site failure at a

time. The two phases of the algorithm are broken into the COMMIT-REQUEST phase, where the

COORDINATOR attempts to prepare all the COHORTS, and the COMMIT phase, where the

COORDINATOR completes the transactions at all COHORTS.

Two phase commit protocol

It works in two phase as given below.

- Phase 1 (Prepare Phase /Voting Phase)

- In this phase coordinator sends a prepare to commit message to all participants of transaction.

In response to that each participant sends a ready to commit or can not ready to commit message

back to coordinator.

Phase 2 (Commit / Decision Phase)

If coordinator receives a ready to commit reply from all participants in phase I

then

it send commit message to all participants

else

it send abort message to all participants.

Page 39: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 38

Distributed Operating System Lab Manual 2019

Assuming that coordinator has sent commit message, all participants now commit transaction

and send complete message to coordinator. If any participant fail during commit then participant

send abort message to coordinator. If coordinator receive at least one abort it ask all participants to

abort otherwise whole transaction is successful.

Page 40: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 39

Distributed Operating System Lab Manual 2019

CODE:

OUTPUT:

CONCLUSION:

REFERENCE:

Advanced Concepts in Operating Systems, Mukesh Singhal and Niranjan Shivaratri, Tata McGraw

Hill, 2001.

http://nptel.ac.in/courses/106106093/26.

http://courses.cs.vt.edu/~cs5204/fall00/distributedDBMS/duckett/tpcp.html

Page 41: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 40

Distributed Operating System Lab Manual 2019

Viva Voce Questions

1. Explain commit protocol ?

________________________________________________________________

________________________________________________________________

2. Explain two phase commit protocol and three phase protocol?

________________________________________________________________

________________________________________________________________

3. What is orphan massage?

________________________________________________________________

________________________________________________________________

________________________________________________________________

Signature of Subject Teacher

Page 42: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 41

Distributed Operating System Lab Manual 2019

EXPERIMENT NO – 10

Aim: Implementation of distributed shared memory

INLAB AIM : Implement a program to illustrate the concept of shared memory.

OBJECTIVES:

To know the concept of shared memory.

To interpret the role of shared memory in distributed application.

To recognize the use of shared memory.

THEORY/ALGORITHM:

Distributed Shared Memory (DSM) is a resource management component of a distributed

operating system that implements the shared memory model in distributed systems, which have no

physically shared memory. The shared memory model provides a virtual address space that is shared

among all computers in a distributed system.

In DSM, data is accessed from a shared address space similar to the way that virutal memory

is accessed. Data moves between secondary and main memory, as well as, between the distributed

main memories of different nodes. Ownership of pages in memory starts out in some pre-defined

state but changes during the course of normal operation. Ownership changes take place when data

moves from one node to another due to an access by a particular process

Page 43: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 42

Distributed Operating System Lab Manual 2019

Steps for Server:

Name the shared memory segment.

Create the segment.

attach the segment to our data space.

put some things into the memory for the other process to read.

wait until the other process changes the first character of our memory to '*', indicating that it has read

what we put there.

Steps for Client:

Get the segment named created by the server.

Locate the segment.

attach the segment to our data space.

read what the server put in the memory.

Finally, change the first character of the segment to '*', indicating we have read the segment.

CODE:

OUTPUT:

CONCLUSION:

REFERENCE:

Advanced Concepts in Operating Systems, Mukesh Singhal and Niranjan Shivaratri, Tata McGraw

Hill, 2001.

Lab Manual of Institute Of Information Technology & Management Gwalior.

www.nptel.ac.in/courses/106106107/Module-5--DistributedDeadlocks

Page 44: Distributed Operating System Lab Manual · CERTIFICATE Certified that this file is submitted by ... Program Educational Objectives (PEOs) The graduates will have a strong foundation

Dr. Mrs. Rahila Sheikh Prof. Imran Ahmad Page 43

Distributed Operating System Lab Manual 2019

Viva Voce Questions

1. What is meant by distributed file system?

________________________________________________________________

________________________________________________________________

2. What are the mechanisms for building distributed file system?

________________________________________________________________

________________________________________________________________

3. What are the designing various design issues distributed file system?

________________________________________________________________

________________________________________________________________

________________________________________________________________

Signature of Subject Teacher