Processes and their implementation Flashcards

1
Q

Independent processes

A

E.g. Four logical program counters switch by copying logical counter

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

Multiprogramming

A

E.g. Single physical program counter and flow of control

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

Logical program counters

A

Meant it stored record of where you were in program
Could split processes in parallel and switch between them using their logical program counter and storing what was there in the physical program counter.

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

Process Model

A

Central operating system concept - Everything built on process model

The abstraction of running program -
- many processes can run the same program
text
- each process has own address space
(isolation)
- a parent process can fork child processes
Provide pseudo concurrent operation even on single CPU (multiple virtual CPUs)

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

Independent sequential processes

A

Each process has own program counter, registers, variables and flow of control.

To run process, copy logical program counter into real physical program counter.

When switch, value of physical program counter is stored in process’ logical program counter in memory.

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

Processes over time

A

Over long period all processes make progress, at any given instance only one is active if single CPU.

CPUs switch rapidly between processes. Rate of progress isn’t uniform, predictable or reproducible.

Can’t make assumptions about timing, need special support for real-time systems.

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

Programs and processes

A

Program - Algorithm expressed in a programming language or other notation.

Process - Activity executing on a processor, has binary program text, input, output etc.

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

Interrupt and Switching

A

Another process requires CPU, save state of current process, switch to other process (may have higher priority or be next in line) with its own program and state.

2 processes may execute same program.

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

Processes and Multiprogramming

A

User runs video editor and web browser, background process periodically checks email.

OS shares processor time between processes - process blocks for I/O allows another process to use CPU
Long computation is divided up and suspended sometimes to give other processes a share of CPU

Suspended processes must restart in exactly same state -
OS saves address space and maintains process table entry for each process with information about resources in it.

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

Process resources

A

OS maintains resources for each process:
- Registers include program counter and stack pointer
- Open files
- Outstanding alarms, list of related processes etc.

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

Address space

A

OS allocates private address space to each process isolated from other processes:

Memory locations the process can read and write:
- Executable program text
- Program data
- The stack (one frame per active procedure or
function)
- Dynamically allocated memory
- Runtime environment

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

Processes and memory layout model

A

Stack
Heap
Unitialised data
Initialised data (global/static variables)
Text (program binary code)

Environment is fixed at run time, fixed set of data.

Program arguments are also fixed at runtime, includes things typed into command line like name of program.

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

Stack

A

Automatic (objects only exist for enclosing scope), managed by OS
Known at compile time (though usage determination by execution trace)

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

Heap

A

For flexibility for what can’t be known until runtime and what can’t fit on the stack.

More costly and error-prone (application programmer requests allocation/deallocation).

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

Process lifecycle and states

A

Processes have a lifecycle managed by OS:
- From creation to termination thorough
intermediate states.

  • In simple systems all processes are created at
    system startup.
  • In general-purpose systems need to create and
    terminate processes during system operation.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Main process creation events

A

System Initialisation - Foreground processes
- Background processes
- Daemons

Execution of a process creation system call by a running process e.g. creating multiple processes to completer a large job.

A user request to create a new process e.g. typing command.

17
Q

Process Termination

A

Processes are created, run and terminate.
Termination - Voluntary (under control of process)
- Involuntary (outside control)

18
Q

Normal Exit (Voluntary)

A

User asks app to quit or process for computation outputs results.

19
Q

Error Exit (Voluntary)

A

Might occur when anticipating an error, or raising exception.

20
Q

Fatal error (Involutary)

A

Not intended by programmer, bug in program.

21
Q

Killed by another process (Involuntary)

A

Another process decides another process should stop e.g. part of the OS could see a process using too many resources and kill it.

Could also occur in a normal event when shutting PC down here the operation system kills existing processes.

22
Q

High level process abstraction

A

View whole system as processes. Structure system in terms of transitions between process states.

Abstract away from low level interrupts from hardware. The OS turns them into process lifecycle events as part of process scheduling.

Some processes perform user tasks and system tasks.

Scheduler manages interrupt handling, starting, pausing and stopping processes etc.

23
Q

Process Trees

A

Processes create (fork) other (child) processes. e.g. running an editor from the command line shell.

a creates b and c. b creates d e and f.

Related processes often need to communicate and share data (need IPC).