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

  Explain the role of determining the speed of a computer

§ Convenience and quality of output are important. Explain what method of output would be best for each of the following situations and explain why

  Creating pseudocode

Create pseudocode for the Citron Car rental policy, Standard transmission is available only for A, B, and C. Automatic transmission is available for all cars.

  Describe how to prevent race condition from occurring

Function and wife calls deposit (). Explain how a race condition is possible and what might be done to prevent race condition from occurring.

  Describe different ways to program producer-consumer problem

Describe two different ways to program producer-consumer problems using shared buffers and semaphores in Windows 7. Think about how to implement the shared buff- er in each case.

  Whenever a computer is idle

Whenever a computer is idle, we can either put it in stand by (where DRAM is still active) or we can let it hibernate. Assume that, to hibernate

  Sorting the ascii words

List all the words in memory that can be considred to be decimal ASCII coded numbers. An ASCII coded word can vary from 3030h to 3939h.

  1 what are the advantages and disadvantages of having a

1. what are the advantages and disadvantages of having a small number of sectors per disk cluster? hint you may want to

  Which occurred when alvin toffler third wave gained speed

Organizations deploying innovative information systems must have the human capital necessary to deploy the new systems. These requirements can be categorized as __________ requirements.

  Write an exploit / attack for the scanf function.

Write an exploit / attack for the scanf function. Explain how the given buffer overflow attack works. Hint: write second program that spits out input.

  What are entities that are swapped out of the main memory

What are the entities that are swapped out of the main memory while swapping the process out of the main memory? What is Fork swap?

  The closing process of a project is the last stage of the

the closing process of a project is the last stage of the life cycle of a project is to finalize all activities across

  Unix system calls and library functionsthe goal of this

unix system calls and library functionsthe goal of this homework is to become familiar with the environment in hoare

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