Week 26 - Process

The process is essentially a running program that is compromised of instructions. OS's make use of the time-sharing technique to allow users to run as many concurrent processes as they want, this is where voluntary and involuntary context switching play a large role. The OS loads its code and any static data into memory and addressing space of the process to run programs. Processes have three states: ready, running, and blocked. In the ready state, a process is ready but the OS hasn't chosen to run it. In the running state, a process is running on the processor and executing instructions. Lastly in the blocked state, a process has performed some operation that makes it not ready to run until some other event happens.

The Process API includes fork(), exec(), and wait() system calls. The fork() call is used to create a new process called child process is an almost exact copy of the parent process. The wait system call is useful for a parent process to ensure that it's child process has finished. Lastly the exec() system call is used for executing a different program.