Processes (OS2 L1&2) Flashcards
Processes
program in execution (with restricted rights)- dynamic entity executing or ready to execute
Job
unit of work in a time sharing/multi-tasking OS
how does a user create a process
double click
cmd
What happens when two copies of a program are running two separate processes
OS generally smart enough to not duplicate resources and allow these processes to share those that they can share
Relationship between process and the OS kernel
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?
True/False - programs can spawn other processes
True, they can also be an execution environment for other processes
Parent process
spawns children processes - forming a tree of processes. Processes are identified by PID
innit systemd launchd
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
Program’s execution context
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
Process lists
used to keep track of processes
each entry is a process control block - contains info that kernel needs to know about the process
process groups
groups of process that are related so that they can be signaled
every process is a member of a group
Fields in PCB
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
for( )
create new process
wait( )
e.g. parent can call wait( ) and wait for child to finish executing before executing itself
exec( )
overlays a process - replaces a process’s mem space with a new program