Processes (6) Flashcards

1
Q

What is a program?

A

In an OS context: an inanimate entity.

In a non OS context: an animate entity.

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

What else other than program code does a process contain?

A

3 memory areas: stack, main, heap. Also contains data store for variables.

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

What is single user vs multi-user systems?

A

Single: only 1 process at a time, processor dedicated to that process.
Multi: several processes interleaved, reasonable response time, allocate resources, support inter-process communication, user creation of process.

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

How are processes created?

A

User logs on, process spawns another process, batch job, created to support service ie printing.

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

How are processes terminated?

A

Log off, quit, error, termination of batch job.

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

List 7 reasons for process termination?

A

Normal completion. Time limit exceeded. Memory unavailable. Bounds violation. Protection error. Arithmetic error. Time overrun (waiting for event to happen).

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

List another 7 reasons for process termination.

A

I/o failure invalid instruction. Privileged instruction. Data misuse. OS intervention (deadlock). Parent terminates so child terminates. Parent request.

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

In two state process model what are two ways a process can occur to be not running?

A

Queuing for it’s turn to start. Was interrupted and is queuing for it’s turn to restart.

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

What advantage has five state model over two state model?

A

Two state doesn’t distinguish between non-running processes ready to to run and non-running processes not yet ready to run.

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

List five states of five state model:

A

New, ready, running, blocked, exit.

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

What initiates transition from one process state to another?

A

Short-term and long-term schedulers.

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

What is the solution to having jus 1 queue for blocked processes?

A

Have multiple separate queues for each event the blocked processes are waiting on.

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

What two types of processes are there?

A

CPU an I/O bound processes.
Cpu mostly calculations.
I/o mostly I/o.

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

What is solution to inefficiency of fast cpu and slow I/o devices?

A

Suspending blocked processes. This frees up memory for adding more processes.

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

What two new states are needed to add suspending of blocked processes?

A

Blocked, suspend. Ready, suspend.

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

How does a locked state become a suspend state?

A

It is swapped to disk.

17
Q

Name five reasons why process may be suspended.

A

Swapping (OS needs main memory to bring in another process), OS reason, user request, timing, parent request.

18
Q

What are constructed so OS can manage all entities of computer system? 4 examples.

A

Tables. Ow memory occupation tables, io tables, file tables, process tables.

19
Q

What 4 attributes make up a process Inge for a process table?

A

Data, program, stack(procedure calls and parameters), process control block.

20
Q

What is PCB?

A

Process control block. Attributes used by OS for process control.

21
Q

What does a PCB contain?

A

All the information about a process needed by the OS. Read by every module in the OS.

22
Q

What are the 4 categories of process information stored in the PCB?

A

ID, status (blocked etc), state and control, accounting.

23
Q

What is process accounting?

A

Info regarding how long process had cpu, how long in system, when it finished, time waiting for I/o, storage used during execution.

24
Q

What is state and control?

A

Information about process relating to register contents (whether interrupted etc), main memory (where it’s stored), resources (what’s been allocated to it), process priority.

25
Q

What five steps happen when a process is created?

A

Assign Pid, allocate space, initialize control block, set up linkages, create data structures (ie accounting file).

26
Q

What are five reasons for context switch?

A

Clock interrupt, I/o interrupt, memory fault (must bring into main memory), trap (error handling), supervisor call (OS call).

27
Q

What are 7 steps of context switch?

A

Save context of cpu registers, update PCB of current process, move process to appropriate queue, select another process, update other process PCB, update memory management data structures, restore context of other process.

28
Q

What is a thread?

A

A unit of dispatching, owned by process, sometimes called a lightweight process, shares resources of parent process, multiple threads mean processes can do more than one thing at a time.

29
Q

Give examples of following OS;

1 process + 1 thread, N processes + 1 thread per process, N processes + n threads per process.

A
1:1= MS DOS
N:1= UNIX
N:N= Windows, Linux
30
Q

What are four benefits of threads:

A

Less time to create new thread than new process, less time to terminate than process, less time to switch between threads within process, threads within process share memory and can communicate together without invoking kernel.

31
Q

What is a process?

A

A program in execution.