Sequential overwrite overwrite the file with 100mb of new


Question: Write a program that creates a 100MB file on your local disk and then measures the time to do each of four things:

(a) Sequential overwrite. Overwrite the file with 100MB of new data by writing the file from beginning to end and then calling fsync() (or the equivalent on your platform).

(b) Random buffered overwrite. Do the following 50,000 times: choose a 2KB-aligned offset in the file uniformly at random, seek to that location in the file, and write 2KB of data at that position. Then, once all 50,000 writes have been issued, call fsync() (or the equivalent on your platform).

(c) Random buffered overwrite.Do the following 50,000 times: choose a 2KB-aligned offset in the file uniformly at random, seek to that location in the file, write 2KB of data at that position, and call fsync() (or the equivalent on your platform) after each individual write.

(d) Random read. Do the following 50,000 times: choose a 2KBaligned offset in the file uniformly at random, seek to that location in the file, and read 2KB of data at that position.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Sequential overwrite overwrite the file with 100mb of new
Reference No:- TGS02271928

Expected delivery within 24 Hours