350 likes | 510 Views
PROCESS MANAGEMENT. Tuğba AĞCAOĞLU & Ahmet GÖKNAR. OUTLINE. What is the Process Management? What is it covers? process state process table, process scheduling. Process State Process Table(process control block) process state memory state resource state Process Scheduling.
E N D
PROCESS MANAGEMENT Tuğba AĞCAOĞLU & Ahmet GÖKNAR
OUTLINE • What is the Process Management? What is it covers? • process state • process table, • process scheduling
Process State • Process Table(process control block) • process state • memory state • resource state • Process Scheduling
What is Multiprogramming Process • Conclusion ; Process Management
What is Process Management? • Ever action run inside a process. • In computer science, a process is an application in execution.
What is Process Management? • Operating system's way of dealing with running multiple processes. • Computing anddistributing "timeshares".
Process State • When a process is using the CPU, it is actually running and doing some work . • If a process does I/O ,the device is not ready or just slow
Process table • The suspended process to be restarted at a later time as if it had never been stopped • The O/S maintains information about each process in a process table
Process table • Process control blocksmust contain information about • process state • memory state • resource state
Process State • The process state must contain all the information • the value of each register • the program counter • the stack pointer
The process is in runnning, runnable, blocked
Memory state • Details of the memory allocation such as pointers to the various memory areas used by the program
Resource state • Information regarding the status of files being used by the process such as user ID
Process Scheduling • Processes are put into a job queue • They are kept in a list called ready queue • The ready queue is generally stored as a link list • Process waiting for a particular device are placed in a I/O queue
Process Queues cpu ready queue i/o I/O queue I/O request time slice expires child executes join fork a child wait queue resource queue resource request
Multiprogramming Process SCHEDULERS: Two types of scheduler: • Long-term schedulers (Job scheduler) • Short-term scheduler (CPU scheduler)
Multiprogramming Process • The short-term scheduler: • selects from among the processes that are ready to execute and allocates the CPU to one of them • must select a new process for the CPU frequently • must be very fast.
Multiprogramming Process The long-term scheduler : • selects processes from a batch system and loads them into memory for execution • executes less frequently
Newly arriving jobs Ready Queue Blocked Running Long-term Scheduler Short-term Scheduler SCHEDULERS
Partially-executed swapped-out processes Ready Queue CPU I/O waiting queues I/O Medium-term Scheduling end
The CPU Scheduler CPU scheduling decisions take place when a process: (i) switches from running to waiting state (ii) switches from running to ready state (iii) switches from waiting to ready (iv) terminates.
Scheduling Criteria • CPU utilization • Throughput • Turnaround time • Waiting time • Response time • Fairness
Scheduling Policies Preemptive Scheduling: • A process switched back and forth between running and ready state • More efficient , better capabilities • More complex and needs hardware support
Scheduling Policies Non-Preemptive Scheduling: • Once a process begins execution, it occupies CPU until it finishes or it blocks • Simplicity • Creates problems
SCHEDULING ALGORITHMS • First-Come-First-Served or FIFO Scheduling • Shortest-Job-first Scheduling • Priority Scheduling • Round-Robin Scheduling
FCFS Scheduling • First process will be served by CPU • Non-preemptive • Waiting time is quite long • Example
FCFS Scheduling Process CPU Burst Time (ms) P1 24 P2 3 P3 3 P1 P2 P3 0 24 27 30 Waiting time for P1 = 0; P2 = 24; P3 = 27 Ave. waiting time: (0 + 24 + 27) /3 = 17 ms.
P2 P1 P3 0 3 6 30 FCFS Scheduling Waiting time for P1 = 6; P2 = 0; P3 = 3 Ave. waiting time : (6 + 0 + 3)/3 = 3 Much better than the previous case, where we had a Convoy Effect:short process behind long process. Results in lower CPU utilization
Shortest-Job-First Scheduling • Selects the shortest job first • Enqueue jobs in order of estimated completion time • It is non-preemptive
Priority Scheduling • Assign a priority to each job and schedule jobs in order of priority • Typically low priority values = “High Priority” • Increasing priority means decrease its priority value • It can be both preemptive or non-preemptive • Equal priority processes are scheduled in FCFS order
Round-Robin Scheduling • Designed for time-sharing systems • Preemptive • Each process gets a small unit of CPU time usually 10-100 milliseconds • After that time the process preempted and added to the end of the ready queue
RESOURCES • http://computing-dictionary.thefreedictionary.com/process+table • http://en.wikipedia.org/wiki/Process_management • http://jan.netcomp.monash.edu.au/OS/l8_2.html • http://www.cs.jhu.edu/~yairamir/cs418/os2/sld007.htm • http://www.bilgiyonetimi.org/cm/pages/mkl_gos.php?nt=131 • http://gaia.ecs.csus.edu/~zhangd/oscal/pscheduling.html