algorithm mak
b) Professor Graph has 500,000 large image files that he needs to convert to another
format. He has a program called ConvertPro that can convert each file. When he
runs it, it will read in an image from disk, do a set of complex computations and
transformations on the data, then write out the new image to disk. Prof. Graph tries
out this program on a sample image and finds that it takes 5 seconds to run-1
second to read in the file, 3 seconds to convert it, and 1 second to write it out again
--on his computer which has a single CPU and a single hard drive, and which uses
direct memory access. He does a little math and figures out that, if he runs the
program one image after another in a simple sequential manner, it will take nearly
a month to process all 500,000 images. He decides that this is too long:
i). Fortunately, Prof. Graph knows a little about the concept of
multiprogramming and realizes that by having his computer convert more
than one image file at the same time, his entire library of 500,000 images
will be converted sooner. In the best case, what percentage of time could he
save using multiprogramming, given the situation described above? Explain
your answer (4 marks).
il). Give an alternate multiprogramming approach to Prof. Graph's and explain
why yours is better. (Note that you aren't able to change the code
for ConvertPro; it will always just read in a single image from disk, do a set
of complex computations and transformations on the data, then write out the
new image to disk.) (4 marks).
iii). Prof. Graph also knows a little about the concept of multiprocessing and
thinks that perhaps adding a second processor to his computer might speed
things up. In the best case, without changing anything else in his system,
what percentage of time could he save using multiprocessing with two
processors, over the amount of time he could already save using
multiprogramming (as given in your answer to part i)? Explain your answer
(4 marks).