next up previous

2.5 Operating Systems     continued...

The third state for a process is blocked. A blocked process is one that is waiting for some external event. For example, if a process needs a piece of data from a file, it will call the operating system routine that retrieves the information and then voluntarily give up the remainder of its time slice. When the data is ready, the system changes the process' state from blocked to idle, and it will be resumed again when its turn comes.

The predominant operating systems for workstations is Unix, developed in the 1970s at Bell Labs and made popular in the 1980s by the University of California at Berkeley. Even though there may be just one user, and that user is executing only one program (e.g. a text editor), there will be dozens of tasks running. Many Unix services are provided by small systems programs known as daemons that are dedicated to one special purpose. There are daemons for sending and receiving mail, using the network to find files on other systems, and several other jobs.

The fact that there may be several processes running in a system at the same time as your computational science application has ramifications for performance. One is that it makes it slightly more difficult to measure performance. You cannot simply start a program, look at your watch, and then look again when the program stops to measure the time spent. This measure is known as real time or ``wall-clock time,'' and it depends as much on the number of other processes in the system as it does on the performance of your program. Your program will take longer to run on a heavily-loaded system since it will be competing for CPU cycles with those other jobs. To get an accurate assessment of how much time is required to run your program you need to measure CPU time. Unix and other operating systems have system routines that can be called from an application to find out how much CPU time has been allocated to the process since it was started.