Week 5: Process: Implementation Unix and WinNT Flashcards
What does the exec system call function do in UNIX?
It replaces the current process with a new process but retains access to open files.
What does the fork system call do in UNIX?
It creates an exact duplicate of the original process, including code, data, program counter, and open files.
What does the wait system call do?
It causes the parent process to block until a child process terminates, returning the process ID of the terminated child.
What happens when a process calls exit?
The process terminates and can return a status value to its parent.
What happens if a parent process terminates before its child?
The child becomes an orphan, and the init process adopts it.
What happens if a child terminates, but the parent is not waiting
The child becomes a zombie and the parent waits
Why are fork and exec separate in UNIX?
- To allow the child process to perform tasks before the exec takes place
- Sometimes they are used alone
How does process creation in MS-DOS differ from UNIX?
MS-DOS suspends the parent process while the child runs, and the parent resumes after the child completes.
What is the “terminate and stay resident” (TSR) mechanism in MS-DOS?
It’s a way to simulate multitasking by allowing a process to remain in memory while other processes run.
What is the basic unit of scheduling in Windows NT?
A thread, which is a lightweight process, sharing the same code and data within a process.
What are the main system calls for process and thread creation in Windows NT?
- CreateProcess for processes
- CreateThread for threads.
How does Windows NT handle synchronization between parent and child processes?
Through message passing and special kernel routines for inter-process communication.
What are the two parts included in a UNIX process structure?
- The user part
- The kernel part
What are the two key data structures related to processes the kernel maintains?
- The process table
- The user structure
What information does a process table hold?
- Process identification: process ID, parent process ID, user ID and group ID of process owner
- Scheduling information: process status (sleeping, executing, swapped), current priority
- Memory image pointers: pointers to the code (instructions), data and stack segments
- Signal information: showing which signals are trapped, ignored, pending, etc.