Starting from:
$35

$29

Homework 09 Solution

RAID ‐ Kills hard drives dead.




For this assignment you will write a program that simulates




a 5‐disk RAID system. The will be five files (each a simulation of a drive) that contain character‐stripped data. These files are named as follows:

drive1.data

drive2.data

drive3.data

drive4.data

drive5.data




Drive1.data will contain characters, for example:




16af




Drive2.data will contain characters, for example:




27bg




Drive3.data will contain characters, for example:




38ch




Drive4.data will contain characters, for example:




49di




Drive5.data will contain characters, for example:




50ej




Your main program must spawn 5 threads, where each thread will read from one hard drive (thread 1 reads from drive 1, etc). These threads must be "detached" and free to read data as they wish.




As a thread reads a character from a drive (data MUST be read character by character) it must pass that datum (character) back to the main program which then must assemble the stripped data into a single block of data.




Once all of the data has been read in the main program must display the assembled block of data. So for the above example you would display:




1234567890abcdefghij




CAVEATS:

‐‐‐‐‐‐‐‐

 
You do not know how big the data files will be, but they will

be of equal size. There will not be blank spaces in the data files.




 
Since the threads are detached, you will need to devise some method to synchronize them or synchronize the data.




REQUIREMENTS:

‐‐‐‐‐‐‐‐‐‐‐‐‐

 
You MUST run this on the CScluster (cscluster.cs.und.edu).




 
Your full name must appear as a comment at the beginning of your program.




 
Your source code must be named hw9‐yourname.c or hw9‐yourname.cpp




 
Email your source (subject hw9‐yourname) to rmarsh@cs.und.edu




1/1

More products