OS3 Flashcards

(23 cards)

1
Q

Compare a program and a process.

A

A program is a file on disk. A process is a program in execution.

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

Define a process.

A

A process is a unit of protection and resource allocation.

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

What does the process store in memory?

A

Text containing the program code. Data containing global variables. Heap containing memory allocated during runtime.

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

Define a process control block, and the values it contains.

A

A data structure representing a process, contains: Process ID, Current process state (running, waiting, etc.), CPU scheduling, memory management, accounting, I/O status information, and Process context.

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

What accounting information does the PCB store?

A

CPU used, Clock time elapsed, Time limits.

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

What IO status information does the PCB store?

A

IO devices allocated to process, List of opened files.

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

What is the process context? State the values it contains.

A

The process context is the machine environment. Contains the program counter and other CPU registers.

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

Define a thread.

A

A thread represents an individual execution context.

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

What does each thread control block contain?

A

Saved context (registers, including program counter), Scheduler info.

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

What does the scheduler do?

A

The scheduler determines which thread to run.

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

What happens in a context switch?

A

Saving the context of the currently executing process. Restoring the context of the process being resumed.

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

State and describe the five process states.

A

New: process is created. Ready: process is waiting for the CPU. Running: process is being executed on the CPU. Waiting: process is waiting for an event. Terminated: process has finished executing.

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

Describe the process tree.

A

Most systems are hierarchical. Parent processes create child processes, forming a tree.

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

Describe how process creation is done on UNIX.

A

fork clones a child process from parent. execve replaces child’s memory space with a new program. Parent waits until child exits.

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

State the 3 reasons of process termination.

A

Process performs an illegal operation. Parent terminates child. Process executes the last statement and exits.

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

Explain cascading termination.

A

If a parent exits, the OS requires children to also exit.

17
Q

State the two models for IPC.

A

Shared memory, Message passing.

18
Q

Explain shared memory IPC.

A

Processes establish some part of memory both can access.

19
Q

Explain message passing IPC.

A

Processes send message to each other mediated by the kernel.

20
Q

Define signals.

A

A form of message passing IPC: asynchronous notifications on another process. Each signal is mapped to an integer.

21
Q

Define pipes.

A

A form of shared memory IPC. Each pipe has a pair of descriptors: one for reading and one for writing.

22
Q

What are named pipes?

A

They appear as files in the filesystem.

23
Q

How are shared memory segments used?

A

Read and write via pointers into the shared memory segment. Need to impose controls to avoid collisions when simultaneously reading and writing.