Chapter 3 Flashcards

(27 cards)

1
Q

What is a process?

A

A process is a program that is running. It includes the program code, current activity, and resources it needs.

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

A program and a process are the same thing. (True/False)

A

False. A program is just instructions on disk. A process is that program running in memory.

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

What are the 4 main parts of a process’s memory?

A

1) Text = code, 2) Data = global variables, 3) Heap = dynamic memory, 4) Stack = local variables & function calls.

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

What are the 5 main process states?

A

New, Ready, Running, Waiting (Blocked), Terminated.

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

The __________ contains all important information about a process.

A

PCB (Process Control Block).

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

What does the PCB store?

A

Process state, program counter, CPU registers, scheduling info, memory info, and I/O info.

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

What is a context switch?

A

When the CPU saves the state of one process and loads another so it can switch tasks.

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

Context switching is free and has no performance cost. (True/False)

A

False. Switching takes time, so it adds overhead.

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

What are the three types of schedulers?

A

Long-term (admit jobs), Short-term (choose next CPU job), Medium-term (pause/resume jobs).

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

What does the long-term scheduler do?

A

Decides which jobs enter the system and controls how many processes are in memory.

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

What does the short-term scheduler do?

A

Chooses which process in the ready queue runs on the CPU next.

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

What does the medium-term scheduler do?

A

Temporarily stops and later resumes processes to balance system performance.

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

Why balance CPU-bound and I/O-bound processes?

A

To keep both CPU and devices busy, improving efficiency.

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

Which process spends more time waiting for I/O?

A

I/O-bound process.

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

A process that mostly uses the CPU is called __________.

A

CPU-bound process.

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

What is the difference between a zombie process and an orphan process?

A

Zombie = finished but parent didn’t collect it. Orphan = parent ended while child is still running.

17
Q

A zombie process is still running. (True/False)

A

False. It has finished but hasn’t been fully removed yet.

18
Q

What is multiprogramming?

A

Having multiple processes in memory so CPU always has work to do.

19
Q

What is the ready queue?

A

A list of processes waiting for CPU time.

20
Q

What is the waiting queue?

A

A list of processes waiting for I/O or some event.

21
Q

What does the degree of multiprogramming mean?

A

The number of processes in memory at once.

22
Q

What causes a context switch?

A

Things like interrupts, I/O finishing, or the scheduler picking another process.

23
Q

Which OS data structure keeps track of processes?

A

PCB (Process Control Block).

24
Q

What is process termination?

A

When a process finishes or is killed, and its resources are freed.

25
The init process adopts orphan processes. (True/False)
True.
26
What does the wait() system call do?
Lets a parent wait for its child process to finish, preventing zombies.
27
Why have multiple scheduling queues?
To separate processes by type (CPU vs. I/O) and manage them better.