Process

Definition

  • A running program.
  • Each process has a unique name known as process ID.

States

  • Running: It is running.
  • Ready: It is ready to run, but the OS decides to not run it.
  • Blocked: It is performing I/O.

APIs provided by OS

  • fork(): Create a new process. The caller is the parent, the created one is the child.
  • wait(): Wait for the child process to complete execution.
  • exec(): Replace the current program with a new program yet using the same process.