Process Termination
• All good processes must come to an end. But how?
• Unix: exit(int status), Windows: ExitProcess(int status)
• Essentially, free resources and terminate
• Terminate all threads (next lecture)
• Close open files, network connections
• Allocated memory (and VM pages out on disk)
• Remove PCB from kernel data structures, delete
• Note that a process does not need to clean up itself
• Why does the OS have to do it?