Week 5: Process: Implementation Unix and WinNT Flashcards

1
Q

What does the exec system call function do in UNIX?

A

It replaces the current process with a new process but retains access to open files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

What does the fork system call do in UNIX?

A

It creates an exact duplicate of the original process, including code, data, program counter, and open files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the wait system call do?

A

It causes the parent process to block until a child process terminates, returning the process ID of the terminated child.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What happens when a process calls exit?

A

The process terminates and can return a status value to its parent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What happens if a parent process terminates before its child?

A

The child becomes an orphan, and the init process adopts it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What happens if a child terminates, but the parent is not waiting

A

The child becomes a zombie and the parent waits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why are fork and exec separate in UNIX?

A
  • To allow the child process to perform tasks before the exec takes place
  • Sometimes they are used alone
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does process creation in MS-DOS differ from UNIX?

A

MS-DOS suspends the parent process while the child runs, and the parent resumes after the child completes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the “terminate and stay resident” (TSR) mechanism in MS-DOS?

A

It’s a way to simulate multitasking by allowing a process to remain in memory while other processes run.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the basic unit of scheduling in Windows NT?

A

A thread, which is a lightweight process, sharing the same code and data within a process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the main system calls for process and thread creation in Windows NT?

A
  • CreateProcess for processes
  • CreateThread for threads.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does Windows NT handle synchronization between parent and child processes?

A

Through message passing and special kernel routines for inter-process communication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the two parts included in a UNIX process structure?

A
  • The user part
  • The kernel part
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the two key data structures related to processes the kernel maintains?

A
  • The process table
  • The user structure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What information does a process table hold?

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What information does the user structure hold?

A
  • Execution state information: values of processor registers, current system call (parameters, results, status), kernel stack
  • File descriptor table: one entry per open file (holds file modes (rw), status, position), information on where to find the file
  • Accounting information: keeps track of total user and system processor time, some implementations have limits to processor, memory, etc.
  • Pointer to process table entry
16
Q

How does the UNIX scheduler work?

A

It uses a two-level system: a low-level (short-term) scheduler for CPU allocation and a high-level (long-term) scheduler for swapping processes.

17
Q

What algorithm does the UNIX scheduler use?

A

Dynamic Priority Queue

18
Q

What 5 rules does the UNIX scheduler use?

A
  • The lower the priority number the higher the priority
  • Kernel processes have priorities less than 0
  • User processes have priorities ≥ 0
  • Kernel processes are not preemptable
  • User processes are preempted after a quantum of 5 ticks
19
Q

What is the usual base priority value?

A

0

CPU(0) = 0

20
Q

What is the formula for recalculating UNIX dynamic priorities?

A
  • priority(n) = base + CPU(n)
  • CPU(n) = ticks_used(n) + CPU(n-1)/2.
21
Q

What is the purpose of the nice system call in UNIX?

A

It allows users to deliberately lower a process’s priority by increasing its base value.

22
Q

How are priorities grouped in WinNT?

A
  • realtime priorities (16 - 31): used for time-critical threads, only available to users with administrator privilege
  • dynamic priorities (0 - 15): used for application program threads
23
Q

How are dynamic priority levels in Windows NT grouped?

A

Into high (11-15), normal (6-10), and idle (2-6).

24
What is the time quantum for the Windows NT scheduler on different systems? ## Footnote The NT scheduler is basically a priority queue
120 ms on NT Server, and 20, 40, or 60 ms on NT Workstation depending on user settings.
25
What happens when a thread requests a system resource in Windows NT?
It is blocked, and the scheduler switches to another thread. When the thread becomes unblocked, it either resumes immediately or is requeued.
26
In which only group of priority levels does the Windows NT have dynamic priority tuning?
Only to dynamic priority levels
27
What events cause priority boosts in Windows NT?
Keyboard or mouse wakeup (+6), other event wakeups (+1), and foreground application boosts.
28
What is priority decay in Windows NT?
In a case in which a thread, which has been boosted, uses an entire quantum without waiting, then its priority decreases by 1 (each time) until it gets back to its original level
29
How does Windows NT prevent starvation?
A high-priority system thread boosts low-priority threads that haven’t executed in over 3 seconds to priority 15.
30
What happens after a thread receives an anti-starvation boost?
It doubles its quantum and immediately executes before returning to its original priority and quantum.