Processes Flashcards

1
Q

what is a program

A

a set of instruction

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

what is a process

A

a program together with its files and metadata

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

what is context

A

information about each process, held in memory.

the environment in which a process operates, including variables and resources.

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

what is an address space

A

the accessible memory locations for a process

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

what is segmentation

A

memory is divided into variable sized chunks

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

where does the OS hold the information about a process

A

process control block

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

what is init

A

the root of the hierarchy of processes in linux

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

what does it mean for a process to fork

A

create a clone of itself- its child.

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

what is an orphan? what happens to the child?

A

the parent expires before the child.

the child is adopted by init and becomes a daemon

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

what is a zombie

A

a child process terminated unnoticed by its parent

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

give the elements that make up a process’ context

A

variables and resources in memory

registers storing:
    state
    memory management page tables
    list of resources the process owns
    cached information
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is multiprocessing? what need does it create?

A

multiprocessing is a resource

it creates a need to communicate between processes

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

how can processes communicate

A

shared memory

files

message passing

signals

pipes

barriers

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

how is IPC performed using shared memory

A

there will be a shared byte where one process can write if it is on and the other can read etc.

it is safe and atomic. May require locks and semaphores

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

how is IPC preformed using files

A

processes alter the file contents

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

how is IPC performed using messages

A

data blocks are sent from one process to another.

synchronous or asynchronous (pipe)

17
Q

how is IPC performed using signals

A

like interrupts but software generated

18
Q

how is IPC performed using pipes

A

a FIFO structure. carries streams or structures messages

19
Q

how is IPC performed using barriers

A

barriers are a method of synchronisation rather than message passing. All processes can proceed once they meet the barrier

20
Q

what is a socket

A

endpoint of communication. method of IPC

21
Q

what are the benefits of multithreading

A

simpler source code- decoded into bits

parallel processing can utilise all cores, giving higher performance

22
Q

what are the drawbacks of multithreading

A

more difficult to program

dependencies must be guaranteed

chance of deadlock

23
Q

what is deadlock

A

processes compete for resources and reach a state where none can proceed

24
Q

what are the methods of preventing deadlock

A

ordering algorithms: the process that has progressed furthest will not be blocked

back off: start again from scratch

central arbiter- processes must ask for a resource

25
Q

what are locks

A

when an operation much be done in divisibly.

26
Q

what are some examples of structural locks

A

system call to claim a resource like memory

writing to a file

27
Q

what are the two options if a lock is busy

A

busy wait (spinlock)- keep checking

block on the lock and context switch

28
Q

how are locks implemented

A

mutex

semaphore

29
Q

what is a thread

A

a single, sequential series of machine instructions.

many threads make up a process.

share the same context

private registers and stacks

share virtual memory maps.

managed by the scheduler

has own state

cooperative scheduling

30
Q

what is a hypervisor

A

layer of software between OS and hardware that allows more than one OS to run on a single machine. Type 1 and type 2

31
Q

what is fork()

A

a system call that calls once but returns twice, once in calling function and once in copy

32
Q

what is a container

A

a container is a term for a virtual computer. splits one machine into many virtual ones.

they share the same kernel but have their own IP addresses and view of the filing system

33
Q

what does chroot do

A

defines a container using the current position as the new root

34
Q

what is a PCB

A

process control block. the OS’s definition of a process. Holds information about a process.