Lecture 3 Flashcards

1
Q

A process is…

A

…a program in execution

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

A process has at least the following:

A
  • Program counter
  • Stack
  • Data section
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Difference between program and process

A

Program is the actual file on the disk, process is the job

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

When you execute a file, the OS…

A

…invokes a process (allocates whatever the program requires to run)

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

Another word for a process is a…

A

…job

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

The stack stores the ____ and grows from ____ to ____

A

Local variables, max to 0

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

The heap stores the ____ and grows from ____ to ____

A

Dynamically allocated memory, 0 to max

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

Data stores ____ and is below the ____

A

Global variables, heap

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

Text stores ____ and is below the ____

A

Program code, data

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

As a process executes, it changes its…

A

…state

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

Process States:

A
  • New (just created)
  • Running (Instructions being executed)
  • Waiting (Waiting for an event to occur)
  • Ready (Waiting for the CPU)
  • Terminated (Process has finished execution)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

OS maintains info about process in…

A

…PCB (Process Control Block)

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

PCB contains what info?

A
  • Process State
  • Program Counter
  • CPU registers
  • CPU scheduling info
  • Memory-management info
  • Accounting info
  • I/O status
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

PCB used to…

A

…switch CPU from one process to another

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

PCB in Linux is represented by…

A

…the C structure task_struct (in a doubly linked list)

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

Processes are maintained in…

A

…queues

17
Q

Ready Queue

A

Set of all processes in main memory, ready and waiting to execute

18
Q

Device Queues

A

Set of processes waiting for an I/O device

19
Q

Two types of processes in queues

A

CPU bound and I/O bound

20
Q

When CPU switches from process to process, the kernel…

A

…saves the state of the first process in first PCB, then loads the state of the second process from second PCB into registers

21
Q

Context-switch time is…

A

…pure overhead (no useful work is done)

22
Q

Typically ____ for switching

A

A few milliseconds

23
Q

Processes may create other processes, forming a…

A

…tree

24
Q

Process creates a child process using…

A

…fork system call

25
Q

Child is a ____ of the parent

A

copy

26
Q

Typically, child loads another program into its address space using…

A

…exec system call

27
Q

Parent waits for…

A

…its children to terminate