1/38
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Process
A sequential execution of program
Process
A name given to a program instance (computer program or application) that has been loaded into memory and managed by the operating system
Process
Sometimes called a job or task
Thread
sequence of instructions within a process
- The executable program itself
- The address space of the process
- The execution context of the process
Components of a Process
Stack
Local variables and functions are allocated at compile-time and placed here
stack, heap
As memory is used by a process, the _____ and the _____ go toward each other
Shared Libraries
f a process makes use of ___________, these are mapped in the memory between the stack and heap
Heap
Data structures explicitly allocated at run-time is placed here
Global Variables
have their own segment in memory that allows for reading and writing
Text
Program code (converted to machine instructions) and other read-only data are placed here
Process Scheduling
Deciding which process/thread should occupy each resource (CPU, disk, etc.) at each moment
-new
-running
-waiting
-ready
-terminated
Process state
New
The process is being created.
Running
Instructions are being executed
Waiting
The process is waiting for some event to occur.
Ready
The process is waiting to be assigned to a processor
Terminated
The process has finished execution.
Process Control Block (PCB)
OS maintains a data structure for each process ____________ that contains the information needed to manage a particular process.
- Process ID number (PID)
- Address space of the process
- Execution context of the process
- List of open files being used by the process
- accounting information
Information stored in PCB includes:
Process Context
Minimal set of state information that must be stored to allow a process to be stopped and re-started later
information stored in the CPU
Context Switching
The Operating System switches the CPU from one process to another
Scheduler
The part of the OS that makes the choice is called the
scheduling algorithm
what algorithm does the scheduler use?
single-processor system
only one process can run at a time; any others must wait until the CPU is free and can be rescheduled
multiprogramming systems
whenever two or more processes are simultaneously in the ready state, a choice has to be made which process to run next.
CPU-I/O Burst Cycle
Eventually, the final CPU burst ends with a system request to terminate execution
- job queue
- ready queue
- device queue
3 Process Scheduling Queues
Job Queues
set of all processes in the system.
Ready Queue
set of all processes residing in main memory, ready and waiting to execute.
Device Queue
set of processes waiting for an I/O device. Each device has its own device queue.
Ready Queue
is stored as linked list
Ready Queue Header
will contain pointers to the first and last PCBs in the list
Long-term scheduler (Job scheduler)
selects which processes should be brought into the ready queue (i.e, selects processes from pool (disk) and loads them into memory for execution).
Short-term scheduler (CPU scheduler)
selects which process should be executed next and allocates CPU (i.e, selects from among the processes that are Ready to execute, and allocates the CPU to one of them)
Short-term scheduler
is invoked very frequently (milliseconds) (must be fast).
Long-term scheduler
s invoked very infrequently (seconds, minutes) (may be slow)
Long-term scheduler
controls the degree of multiprogramming (the number of processes in memory).