in Operating System
974 views
0 votes
0 votes
Can a measure of whether a process is likely to be CPU bound or I/O bound be determined by analyzing source code? How can this be determined at run time?
in Operating System
by
974 views

1 Answer

0 votes
0 votes

In simple cases it may be possible to see if I/O will be limiting by looking at source code. For instance a program that reads all its input files into buffers at the start will probably not be I/O bound, but a problem that reads and writes incrementally to a number of different files (such as a compiler) is likely to be I/O bound. If the operating system provides a facility such as the UNIX ps command that can tell you the amount of CPU time used by a program, you can compare this with the total time to complete execution of the program. This is, of course, most meaningful on a system where you are the only user.

Reference: https://met.guc.edu.eg/Download.ashx?id=29695&file=OS_PA_3_Summer_19_29695.pdf

Related questions