Processes and Threads Flashcards

1
Q

The Three Process States

A
  1. Ready
  2. Blocked (waiting)
  3. Running
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Call Stack

A

Stack data structure that stores info of active function calls. Composed of stack frames. Grows when new call issues and shrinks when function call returns.

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

Stack Frame

A

Part of a call stack. Corresponds to a function call. Includes:
- passed-in args
- return address
- saved register values
- local variables

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

esp

A

Stack pointer, holds top of stack

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

ebp

A

Base pointer, stores previous esp value, restored after function return

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

Execution Context

A

Content of the CPU registers at any point of time (also known as processor state). Includes:
- program counter
- call stack pointer
- location of allocated memory

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

Program Counter

A

Specialized register that indicates the address of the instruction to be executed next

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

Call Stack Pointer

A

Indicated top of the kernel-space call stack for the process (esp?)

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

Process State VS Processor State

A

Process State: running/blocked/ready
Processor: execution content

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

PCB

A

Process Control Block, instance of a data structure in the kernel mem containing info needed to manage a particular process.

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

What is stored in a PCB?

A
  • execution context info
  • process ID
  • process control info (scheduling state, opened FDs, more…)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Process Switch

A

Occurs when OS Scheduler suspends the execution of one process on CPU and runs another. 1st process in scheduled out the second process is scheduled in.

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

Process Switch Steps

A
  1. Store context of current process into its PCB
  2. Scheduler picks a process in the ‘ready’ list
  3. Use PCB of picked process to restore contents of the CPU registers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When does Process Switch occur?

A
  • process blocks
  • process yields
  • process exits
  • CPU time slice is used up
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

CPU Timing

A

Timer issues interrupt. CPU time allocation under control of CPU

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