logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Hariom KasyapFinance
(5/5)

691 Answers

Hire Me
expert
Rameshwar DassHistory
(5/5)

592 Answers

Hire Me
expert
Angel MoralesLaw
(5/5)

736 Answers

Hire Me
expert
StatAnalytica ExpertMathematics
(5/5)

654 Answers

Hire Me
C++ Programming

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

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. 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

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme