In 5-8 sentences typed
1) What are I/O-bound and CPU-bound processes? Describe their behavior as it relates to CPU scheduling.
2) What is a context switch? How does it affect process scheduling?
3) Describe the creation of new processes using the fork() and execv() commands. Include the waitpid() function in your discussion.
1) I/O bound processes are ones that deal with Input-Output and CPU bound processes are those which deal with using the processor. Generally, no process is pure CPU bound or pure I/O bound, most processes are a combination of both.
2) A CPU can run only one process at a time. To give the impression of multiprocessing, the CPU rapidly switches between processes so that all of them can be handled simultaneously, well,sort of. This is called context switching. There are many algorithms around which process should get a chance to run on the CPU , and according to those algorithms the next processes that gets to run on the CPU is decided.
3) Fork is used to create a copy of the fork-ed process. The newly created process is a replica of the parent process and has a new processId. It has the process ID of the process that forked it as its parent process ID (ppid). The fork function for the child returns 0 whereas the fork function of the parent returns the process ID of the child.
Exec however is used to replace the current process with a new process.
The parent waits for the child while it is processing.
In 5-8 sentences typed 1) What are I/O-bound and CPU-bound processes? Describe their behavior as it...