Write a program to model deadlock detection

Assignment Help Operating System
Reference no: EM131295981

Deadlock/Scheduling/Virtual Memory - Operating Systems

PROBLEM A:

Write a program to model deadlock detection. The program will accept a list of processes, resources, requests, and releases in the following format:

A req R

A req S

A rel R

A rel S

B req S

B req R

B rel S

B rel R

The program will then produce possible orderings of the resource requests/releases. Orderings within a process cannot be rearranged (so A must always request R before it can request S in the example above), however orderings across processes can be rearranged (B can request S and R before A requests R). Each ordering will be output with a header, the ordering, and an indication if the order causes a deadlock or not.

For example:

ORDER 1: A req R, A req S, A rel R, A rel S, B req S, B req R, B rel S, B rel R ORDER 2: A req R, A req S, A rel R, B req S, A rel S, B req R, B rel S, B rel R
...
ORDER x: A req R, B req S, A req S, B req R DEADLOCK!

Try your program with the following input files:

--------------File 1------------
A req R A req S A rel R A rel S B req S B req R B rel S B rel R

--------------File 2------------
A req R A req S A rel R A rel S B req S B req T B rel S B rel T C req T C req R C rel T C rel R

PROBLEM B:

Design, implement, and gather results for a set of experiments to determine:
- the OS quantum
- the OS context switch overhead

Hints (you can ignore these if you have your own idea):
- Use a HIGH RESOLUTION TIMER
- You may need more than one thread/process for this
- You can look up the number of context switches that process has performed
- For the quantum measurement, you want your thread/processes to be doing work, you can also check your result against: sched_rr_get_interval. This method may work for you... I've had some success with it... however I've also had students with problems with this method... it simply returns a quantum of 0. Try it.
- For the context switch overhead measurement, you want your thread/process to not be doing work

Place your results in a README.TXT file.

PROBLEM C:

Write a program that simulates a paging system using the following reference string: 0 2 1 3 5 4 6 3 7 4 7 3 3 5 5 3 1 1 1 7 2 3 4 1
Assume that the computer can hold only FOUR page frames at any one time. Your program should output the number of page faults when simulating the following page replacement algorithms:
- Optimal (do not hard code this, you must determine this from the reference string in your program)
- FIFO
- LRU

Based on the results from the simulation. Which algorithm is the best? Which algorithm is the worst? Why?

Reference no: EM131295981

Questions Cloud

Write a program that synchronizes the threads : CS314 Operating Systems - Write a program that synchronizes the threads such that deadlock does not occur and no little rascal starves. The output should specify which rascal is eating.
Assignment incorporates the concepts from prior weeks : The following assignment incorporates the concepts from prior weeks (variables, if-else logic, loops, and arrays), along with this week's topic of file input/output process.
What is the value of the temperature difference : When t is very large, what is the value of the temperature difference? What is the temperature of the water at this time? What could you do to your experimental apparatus to decrease the value of k in another run? What quantity does k measure?
Bought a new hard drive for your computer : You just bought a new hard drive for your computer. You plan to use this as a secondary hard drive to store all your UMA files. Once installed, what needs to be done to the drive and what do these two tasks do?
Write a program to model deadlock detection : Design, implement, and gather results for a set of experiments - Write a program to model deadlock detection - Write a program to model deadlock detection and Write a program that simulates a paging system
Important a web server : We know how important a web server is and how it can be used, but what is DNS used for? What is DHCP?
Manage template design and development : Consider this scenario. You work for a five star international hotel. You are responsible for training junior employees about the appropriate style and layout of documents.
Unlimited amount of funds : Pick a type of business you would start if you had an unlimited amount of funds. What type of information system would you use to achieve your strategy? What business processes would you use to keep the business going?
President of the united states : Recent election of Donald Trump as next the president of the United States has created major uncertainties in many areas including the US economy, US relationship with the rest of the World, immigration issues and possible deportation of many peop..

Reviews

Write a Review

 

Operating System Questions & Answers

  How many page faults are generated using lru replacement

How many page faults are generated by the following arrayinitialization loops, using LRU replacement, and assuming page frame 1 has the process in it, and the other two are initially empty.

  Select one of two possible short reportsfor your second and

select one of two possible short reportsfor your second and final assignment in this class i would like to ask you to

  Question about software and staff training

As was stated before, the corporation X is going to expand its data system. To do this, it is going to choose and buy new hardware and software and retrain workers.

  Intermediate level tasks below is a simple program it

intermediate level tasks below is a simple program. it creates 2 threads. the first thread keeps printing out x on the

  Question 1a explain two reasons driving the creation of

question 1a explain two reasons driving the creation of processes.b suppose we want a system to have two ready states

  What are wireless solutions

Will this proposed solution meet the requirements? Would you propose the same? Explain your answer.

  Determine the average seek time of traversed disk

Traversed Disk receives request to access random sector on random track. Suppose head starts at track 0. Determine the average seek time?

  What is the office automation and group collaboration s/w

What is the office automation and group collaboration software which is used in any oraginization

  How deep can the procedure calls go before registers

How deep can the procedure calls go before registers must be saved in memory? (That is, what is the maximum number of "active" procedure calls that can be made before we need to save any registers in memory?)

  Question regarding the linux flavors

Look up the different types of Linux and Unix and type up a 1 page listing them out what benefits do each have and where you found the OS at.

  Starting from the current head position

Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests for each of the following algorithms

  Computing the access time

Main memory uses a block transfer capability & has 1st word (four bytes) access time of fifty ns and access time for following words as 5 ns.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd