1/16
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Process
A program that is being executed; Unit of work in a modern time sharing system
Processes that make up a system
Operating systems processes executing system code and user processes executing user code
What is the benefit of switching the CPU between processes
Doing so makes the computer more productive
Components of a process
Text section (code), data section(global variables), heap(memory), stack (temporary data)
States of a process
New (created) Running (instructions being executed) Waiting (Process is waiting for some event to occur) Ready (Waiting to be assigned to processor) Terminated (Finished execution)
Process Control Block (PCB) Contains
Process state (new, ready, etc...)
Program Counter (Address of next instruction)
CPU Registers
CPU Scheduling information (process priority, etc...)
Memory Management information ()
Accounting Information
I/O Status information
Process Scheduler
Selects process for execution on CPU
Job Queue
Holds All processes in system
Ready Queue
Holds processes in main memory that are waiting to be executed. Usually in linked list.
longterm/job scheduler
Selects processes and loads them into main memory where they await execution
short term scheduler/ cpu scheduler
Selects processes that are ready to execute and allocates cpu to one of them
I/O bound vs CPU bound
An I/O-bound process is one that spends more of its time doing I/O than it spends doing computations. A CPU-bound process, in contrast, generates I/O requests infrequently, using more of its time doing computations.
Swapping
Processes are swapped in and out of main memory to the disk
Context Switch
Switching the CPU to another process requires performing a state save of the current process and a state restore of a different process
fork()
System call that creates a new process
exec()
loads binary file into memory and starts its execution
wait()
Used by parent process to movie itself off ready queue until termination of child