Remember:
- FCFS/SJF has a better CPU throughput than SRTF because of less context switching
- The shell is a user program; the C standard library is linked to user programs. Device drivers and the scheduler are typically part of the kernel.
- Open file descriptors are preserved across the (Linux) exec syscall. That’s why we call dup2 before fork in the shell homework.
- When one process starts another with the
exec
system call, the child process inherits its parent’s current directory. After that, the two processes’ current directories are independent, so that either changing its own current directory has no effect on the other. (This is why, under Unix, the cd
command is a shell built-in, not an external program.)
sp21-mt2