processes Flashcards

1
Q

what is a process

A

a running instance of a program

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

what is the role of the linker

A

puts object files together to create an executable

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

what is the role of the loader

A

takes an executable file from the file system
reads the file to make sure that the different libraries needed are loaded into memory so they’re available for use
then it makes an execution

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

what is a thread

A

a flow of execution within the process; sequencing instructions as part of a program

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

why are threads more efficient than processes

A

dont need to have file permissions and other recourses

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

what is the process context

A

information that describes what the process is doing

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

what could a process context contain

A

registers
memory layout
open files
where programs are within a file; r/w position
access permissions to a file
any communication happening
timers and alarms
recourses used by child processes

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

what is a process control block

A

a table containing the process context

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

what is the stack typically used for

A

implements function calls; a new stack frame is added at the top
it stores parameters and return values and any declared variables

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

what is the role of the heap

A

dynamically allocated memory; holds things that you wont know the length of
e.g. strings, queue, by overestimating the size
requests at runtime

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

how do we expand the heap

A

using sbrk()

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

what is the problem with the heap overestimating the size of the data

A

creates wasted space

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

meta data

A

describes the layout of the program and is used by the loader to build the memory layout
also includes libraries we want to use whilst a program is running

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

how do we run multiple processes

A

we switch between and store the context of the process being suspended in the process control block
we then determine which process will run next and recover the context and load it into registers then continue

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

what is the point of the process hierarchy

A

allows processes to spawn child processes

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

why do we limit the amount of children that a process can have

A

so it doesnt get an advantage in the system as more children could mean more resources

17
Q

why do we have a limit on the number of processes allowed in the system

A

so it doesnt get overwhelmed

18
Q

how do we ensure proper resource control within the process hierarchy

A

each process is responsible for its own resources as well as its children

19
Q

what call so we use to create a process

20
Q

how does fork() work

A

when called it creates a duplicate process which are identical except for the values returned to them

21
Q

what does fork() return if youre a child

22
Q

what does fork() return if youre a parent

A

the process id of the child

23
Q

what is the point of the parent receiving the process id of the child after calling fork()

A

allows you to call want() for any children to get their information

24
Q

what happens when a child calls exit()

A

it enters a zombie state; the child has finished execution however all resources are still held in the os
when the parent calls wait() then all resources are transferred to the parent which is added to the resource total that the parent has to account for

25
Q

what is an uninterruptable io mode/operation

A

once you start the operation you must complete it

26
Q

what is an interruptible io mode/operation

A

can be stopped to complete other processes

27
Q

what is the life cycle of a process

A

starts at ready; it has been initialised and is ready to run
it is moved to the running state once selected for execution
can either carry out an io operation, we can choose when we want it to stop, or it will run for a defined amount of time in the system
the process exits then enters the zombie state and recourses are ready to be collected by its parent