Processes (OS2 L1&2) Flashcards

1
Q

Processes

A

program in execution (with restricted rights)- dynamic entity executing or ready to execute

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

Job

A

unit of work in a time sharing/multi-tasking OS

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

how does a user create a process

A

double click

cmd

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

What happens when two copies of a program are running two separate processes

A

OS generally smart enough to not duplicate resources and allow these processes to share those that they can share

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

Relationship between process and the OS kernel

A

process is the abstraction for protected execution provided by the operating system kernel
process needs permission from kernel before accessing memory of any other process - amongst other things
Kernel maps user process to be executed by hardware?

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

True/False - programs can spawn other processes

A

True, they can also be an execution environment for other processes

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

Parent process

A

spawns children processes - forming a tree of processes. Processes are identified by PID

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

innit systemd launchd

A
examples of parent processes that are the parent of all other processes on the system 
first process executed
manages all other processes
started by kernel
PID = 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Program’s execution context

A

basically, surrounding info needed for running the process effectively

  • state of processor (processor context) which is the value of its program counter and all registers
  • process memory map - identifies various regions in memory that have been allocated to the process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Process lists

A

used to keep track of processes

each entry is a process control block - contains info that kernel needs to know about the process

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

process groups

A

groups of process that are related so that they can be signaled
every process is a member of a group

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

Fields in PCB

A

process state
program counter
CPU registers - contents of all process centric registers
CPU scheduling information - priorities etc
Mem management information - mem allocated to process
Accounting info - cpu used, clock time elapsed
I/O status information - i/o devices allocated to process

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

for( )

A

create new process

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

wait( )

A

e.g. parent can call wait( ) and wait for child to finish executing before executing itself

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

exec( )

A

overlays a process - replaces a process’s mem space with a new program

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

Resource sharing options between parent and children

A

share all resources
children share subset of parent resources
no sharing

17
Q

Execution options for parent and children processes - after fork( )

A

execute concurrently

parents wait until children terminate

18
Q

Address space option for parent and children processes

A

duplicated

child has other program loaded into it

19
Q

how many processes per processor at a time

20
Q

new state

A

process being created

21
Q

running

A

instructions being executed

22
Q

waiting

A

process waiting to event to occur

23
Q

ready

A

process waiting to be assigned to a processor

24
Q

terminated

A

process finished execution

25
"System is in the context of that process"
When a process is running its said that System is in the context of that program
26
What needs to be saved during a context switch
enough information so that the kernel can switch back to the earlier process and continue from the exact same place it left off
27
Short term scheduler
selects process to be executed next, invoked frequently
28
long term scheduler
selects processes to be brought into the ready queue. - controls the degree of multitasking
29
i/o bound processes
spend more time doing i/o - many short cpu bursts
30
cpu bound processes
spend more time doing computations - few long cpu bursts
31
Reasons for IPC (cooperating processes)
information sharing Computation speedup - parallelization Modularity
32
name the two IPC models
shared memory | message passing
33
explained shared memory as an IPC model
two or more processes agree to remove restrictions (relating to preventing one process from accessing another's memory) and exchange information by reading and writing data to shared areas
34
explained message passing as an IPC model
send() receive() - parents and children can send messages via a pipe
35
what happens upon process termination?
executes last statement and asks OS to delete it using exit( ). On exit a process may return status value (typically an int) to waiting parent process. On exit all process resources are reclaimed by OS
36
why is a terminate system call only allowed to be invoked by parent process?
otherwise user or misbehaving application could kill another process parent needs to know identities of children to terminate them
37
why would a parent process terminate its child process
child exceeded allocated resources Task assigned to child is no longer required parent is exiting and OS does not allow child with out a parent
38
zombie process
A zombie process or defunct process is a process that has completed execution but still has an entry in the process table as its parent process didn't invoke an wait() system call.
39
Orphan process
An orphan process is a computer process whose parent process has finished or terminated, though it (child process) remains running itself.