Earn Higher Grades With Instant Assignment Help.Ask Question!

C++ Programming
(5/5)

In this exercise we will study a hypothetical magnetic hard drive, but as close to a real-world problem as I can dream up.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Programming Exercise #6

Deadlock Prevention

Overview

In this exercise we will study a hypothetical magnetic hard drive, (no real basis in reality), but as close to a real-world problem as I can dream up.  Suppose that an engineering firm has created a novel way to increase hard drive read performance by adding additional read/write heads (not far from reality).  However, as the system is undergoing tests, it has become clear that when two adjacent heads try to read or write at the same time, the data becomes corrupted.  In this exercise, the coder will implement an algorithm to allow the read/write heads to be as busy as possible, but not corrupt the data from the adjacent head.

Multi-Head Hard Drive Architecture

As shown in the figure below, a national hard drive has been developed with N heads.  However, it is a requirement no two adjacent heads can be reading or writing at the same time due to interference issues.  And, as usual, rather than fix the hardware, it has fallen on you as the computer engineer to work around the issue in your embedded code.  For this exercise, the student need not worry about read/write ordering nor how the read/write actually happens, (that is all well-developed code).  The only thing the coder is concerned with is ensuring that no two adjacent heads are engaged at the same time.  Your system must also never deadlock.  Don’t worry about head starvation or make any other attempt at fairness.  That will be handled by the algorithm that calls into your code.

 

Figure 1. Notional Hard Drive

Programming Concepts

This exercise covers many programming concepts including deadlock, threads, reference counting pointers, templates, STL library, mutexes, abstract classes and inheritance, lambdas, closures, and functors.

System Requirements

See grading rubric for grade values associated with specific system requirements.  Additional requirements/hints are shown below:

  1. The design must use the provided header verbatim. This will allow automated testing of the design you produce. 

  2. You may (should) create derived classes of your choosing

  3. Implementation of functions in the abstract base class is acceptable

  4. Your main should not be in the same implementation file as your other classes

  5. Consider a rigorous main program that adequately tests your deadlock-free algorithm

Attachments:
(5/5)

Related Questions

CSI 1420 Introduction to C Programming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two majorconstructs of the C programming language – Fu

The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Assignment To Be Done By Our ExpertsGet A+ Grade Solution Guaranteed

expert
joyComputer science
(4/5)
12 Answers Hire Me
expert
Robert DLaw
(4.8/5)
965 Answers Hire Me
expert
Dr Samuel BarberaStatistics
(5/5)
834 Answers Hire Me
expert
Tutor For YouEconomics
(5/5)
923 Answers Hire Me