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

  Write a c++ program for little man''s computer

A text file containing machine code (not assembly code) for little man's computer following instruction set . Instructions are in different lines (no need for semicolon at the end of each instruction)

  Calculate the maximum data rate in mb/second

b)How much cylinder skew is needed for an Oceangate disk operating at 20,000 rpm(new series for the Christmas promotions) which has a seek time of 0.5 milliseconds? This disk has 800 sectors of 512 bytes each on each track.c) Calculate the maximum da..

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Calculate waiting and average waiting time

A program that can do cpu scheduling algorithm priority using javascript or php to display gaant chart and calculate waiting and average waiting time

  Question no1consider a scenario of post mailbox there are

question no.1consider a scenario of post mailbox there are two processes named sender s and receiver r. both processes

  Testing a motherboard

Assume you wish to test a motherboard used in an installation before you proceed too far into the installation. From the devices listed below, choose the minimum devices

  Given separate instruction and data cache units

Given separate instruction and data cache units, the MIPS ISA, an instruction cache miss rate of 15%, a data cache miss rate of 20%, and a miss penalty (for both cache units) of 5 clock cycles, what are the AMAT in cycles per access of the.

  Operating systems that can be used in health care delivery

Discuss at least 2 operating systems that can be used in health care delivery. Your discussion should include descriptions of at least 2 operating systems such as, but not limited to, the following: Windows and Unix

  Discuss the merits of each file management system

Discuss the merits of each file management system - Methods available for file manipulation and how user-defined permissions are implemented and can be examined.

  Explain the concepts of consumable and reusable resources

Explain the concepts of consumable and reusable resources

  Identify issues of poor technology management

Assume you are the task manager for a large consumer service corporation consisting of 1,000 workers. You are responsible for 25 direct reports in your department.

  Describe three approaches to organizing programming teams

Briefly describe direct, parallel, and phased installation. What are the advantages and disadvantages of each installation approach?

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