Lecture 4, part 1: Processes

Previous lecture Next lecture

Exam

Details about the process abstraction and its use in Unix

Important questions:

Review: processes..

Unix (Thompson and Ritche 1968)

Unix variants

Unix processes

Unix shells

Unix shells: job control

Standard I/O channels

Redirecting standard I/O

The Unix philosophy

This is commonly expressed in a shorter way: "Do one thing, do it well."

Lecture 4, part 2: Processes

Process-OS interaction in Unix (1)

Process-OS interaction in Unix (2)

Process-OS interaction in Unix (3)

Unix process control: syscalls

A first overview of process related system calls (syscalls)

Syscall Description Manual section
getpid returns PID of the calling process (2)
getppid returns PID of the parent process (2)
getuid return the UID of the calling process (2)
fork creates a new child process (2)
exit terminates the calling process (3)
_exit terminates the calling process (2)
wait waits for the termination of a child process (2)
execve loads and starts a program in the context of the calling process (2)

Read Unix manual pages with man <num> <command>

Unix processes in detail: fork()

System call: pid_t fork(void)

Use of fork()

Discussion: fast process creation

Unix processes in detail: _exit()

System call: void wait(int)

Discussion: orphaned process

Unix processes in detail: wait()

System call: pid_t wait(int *)

Use of wait()

Discussion: zombies

Unix processes in detail: execve()

System call: int execve(const char *command, const char *args[], const char *encp[])

Use of exec()

Discussion: why no forkexec()?

Unix process states

Conclusion