S371 Operating Systems) Programming Assignment 4: uring the Performance of VO System Calls Measurim Purpose In writing programs. and the The goal of this assignment is to get experience hacoct of making Oment simple this assignment, you will be required to look at the cost of making routines and how to use them the situations. For system programs, it is definitely not sufficient to calls, LO system rating this cost. You will learn how to implement simple timing to measure the time it takes to read a large file under various Requirements You will measure the time to read from a large file using two different input calling the UNIX read system call, and (2) using the routine: (1) directly ead. standard I/O library routine r our program will read the input file several times (10 to be exact): for each of the two cases will c, you will use a read size of 1, 10, 100, 1000, and 10000. In other words, your program Wi put tile, read its entire contents 1-byte at a time using the read system call, then read though the file, reading 10- close the file. Your program will then open the file again and bytes at a time, and so on, up to 10000 bytes at a time. Your program will then repeat these five cases, but using the fread call instead of read. You will measure the elapsed times for each of the 10 test cases. Before the start of your read loop, your program will call the time time. The difference between these two values is the elapsed time. You will also record the number of read operations (numbers of calls to read or tread). system call; immediately after the loop, it will again call Note that t ime only is precise only to a second. This precision is not sufficient for this assignment, so you more precise measurement methods, such as the rdtsc instruction on a should use a more precise measure, the gettimeofday call. (There are even Pentium processor.) Input File Your will test your probstantial difference in the timings as you run your test cases. against a very large file C-100,000,000 bytes in size). As a result, Experimental Method is a well-established regimen, used in all areas of science. The use of keeps us honest and gives form to the work that we do. S371 Operating Systems) Programming Assignment 4: uring the Performance of VO System Calls Measurim Purpose In writing programs. and the The goal of this assignment is to get experience hacoct of making Oment simple this assignment, you will be required to look at the cost of making routines and how to use them the situations. For system programs, it is definitely not sufficient to calls, LO system rating this cost. You will learn how to implement simple timing to measure the time it takes to read a large file under various Requirements You will measure the time to read from a large file using two different input calling the UNIX read system call, and (2) using the routine: (1) directly ead. standard I/O library routine r our program will read the input file several times (10 to be exact): for each of the two cases will c, you will use a read size of 1, 10, 100, 1000, and 10000. In other words, your program Wi put tile, read its entire contents 1-byte at a time using the read system call, then read though the file, reading 10- close the file. Your program will then open the file again and bytes at a time, and so on, up to 10000 bytes at a time. Your program will then repeat these five cases, but using the fread call instead of read. You will measure the elapsed times for each of the 10 test cases. Before the start of your read loop, your program will call the time time. The difference between these two values is the elapsed time. You will also record the number of read operations (numbers of calls to read or tread). system call; immediately after the loop, it will again call Note that t ime only is precise only to a second. This precision is not sufficient for this assignment, so you more precise measurement methods, such as the rdtsc instruction on a should use a more precise measure, the gettimeofday call. (There are even Pentium processor.) Input File Your will test your probstantial difference in the timings as you run your test cases. against a very large file C-100,000,000 bytes in size). As a result, Experimental Method is a well-established regimen, used in all areas of science. The use of keeps us honest and gives form to the work that we do