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

A

1

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
Q

“System is in the context of that process”

A

When a process is running its said that System is in the context of that program

26
Q

What needs to be saved during a context switch

A

enough information so that the kernel can switch back to the earlier process and continue from the exact same place it left off

27
Q

Short term scheduler

A

selects process to be executed next, invoked frequently

28
Q

long term scheduler

A

selects processes to be brought into the ready queue. - controls the degree of multitasking

29
Q

i/o bound processes

A

spend more time doing i/o - many short cpu bursts

30
Q

cpu bound processes

A

spend more time doing computations - few long cpu bursts

31
Q

Reasons for IPC (cooperating processes)

A

information sharing
Computation speedup - parallelization
Modularity

32
Q

name the two IPC models

A

shared memory

message passing

33
Q

explained shared memory as an IPC model

A

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
Q

explained message passing as an IPC model

A

send() receive() - parents and children can send messages via a pipe

35
Q

what happens upon process termination?

A

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
Q

why is a terminate system call only allowed to be invoked by parent process?

A

otherwise user or misbehaving application could kill another process
parent needs to know identities of children to terminate them

37
Q

why would a parent process terminate its child process

A

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
Q

zombie process

A

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
Q

Orphan process

A

An orphan process is a computer process whose parent process has finished or terminated, though it (child process) remains running itself.