1 / 24

Operating Systems { week 04b}

Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D. Operating Systems { week 04b}. Systems and models. A system is a part of the real world that we wish to analyze Made up of autonomous entities interacting with one another

bethan
Download Presentation

Operating Systems { week 04b}

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D. Operating Systems{week 04b}

  2. Systems and models • A system is a part of the real worldthat we wish to analyze • Made up of autonomous entitiesinteracting with one another • A model is an abstractrepresentation of a system • We use models in analysis and design • Only relevant properties are included

  3. Using models for analysis (i) • Simulate a system’s behavior using a model • Models have tunable input parameters • Observe the simulation; analyze output • Predict behavior of the real systemby analyzing behavior of the model • Behavior of the model depends ontime, input parameters, and eventsgenerated within the environment

  4. Using models for analysis (ii) • We can model numerous systems usingthe following components: • User: a single user of the system • Service: a node providing a service • Queue: an array of users waiting for service

  5. Modeling uncertainty • Mathematical models can be categorized as: • Deterministic: • Behavior is predictable with 100% certainty • Stochastic: • Behavior is uncertain, based on random events

  6. Stochastic models • A stochastic model is one thatincorporates uncertainty intoits behavior • One or more attributes change their values according to a probability distribution

  7. Probability distributions (i) • A probability distribution specifies the probability of each value of somerandom variable • Uniform distribution: • All values areequally probable

  8. Probability distributions (ii) • A probability distribution specifies the probability of each value of somerandom variable • Normal distribution: • Values are moreprobable at ornear the mean • This will forma bell curve

  9. Probability distributions (iii) • A probability distribution specifies the probability of each valueof some random variable • Exponential distribution: • Values are times betweenevents in a Poisson processin which events occur bothcontinuously and independently,but at a constant average rate

  10. Analyzing operating systems (i) • To study the performance of an operating system, we can: • Take measurements onthe real system • e.g. Unix time command • Run a simulation model • Apply an analytical model • e.g. Queuing theory, exponential distributions, etc.

  11. Analyzing operating systems (ii) • External performance goals: • Minimize user response time • Maximize throughput • Number of jobs completed per unit time • Minimize turnaround time • Average time to complete jobs • Maximize fairness • Maximize degree of multiprogramming • Number of processes supported without degradation

  12. Analyzing operating systems (iii) • Internal performance goals: • Maximize CPU utilization • Maximize disk utilization • Minimize disk access time • Enforce priorities • Minimize overhead • e.g. time for scheduling algorithm, context switching • Avoid starvation of long-running jobs • Enforce real-time deadlines (sometimes)

  13. Analyzing operating systems (iv) • Some key performance measures: • Average number of jobs in the system • Average number of jobs waiting in a queue • Average time a job spends in the system • Average time a job spends in the queues • CPU utilization • Total number of jobs serviced (i.e. throughput)

  14. Process scheduling and queues • Processes are created bythe operating system • Processes initially added toa job queue, which containsall processes waiting to enter the system • From the job queue, processes thatare ready for execution are addedto the ready queue

  15. Schedulers • A long-term scheduler (i.e. job scheduler) selects processes from the job queue, adding those processes to the ready queue • A short-term scheduler (i.e. CPU scheduler) selects processes from the ready queueand allocates time with the CPU

  16. Long-term scheduling (i) • The long-term scheduler isinvoked infrequently

  17. Long-term scheduling (ii) • The degree of multiprogramming ofan operating system is defined asthe number of processes in memory • In a stable operating system,the average process arrival rate equalsthe average process departure rate

  18. Short-term (CPU) scheduling (i) • The short-term scheduler decides which process the CPU executes next • The dispatcher gives control of the CPU to the process selected by the CPU scheduler: • Performs context switch • Switches to user mode • Jumps to the proper location in the user program to resume program execution

  19. Short-term (CPU) scheduling (ii) the dispatcher operates here

  20. CPU-I/O burst cycle (i) • Processes alternate betweenCPU execution and I/O wait • A CPU burst is actual programexecution that uses the CPU • An I/O burst is a blocked state • Each process starts and endswith a CPU burst

  21. CPU-I/O burst cycle (ii) • Histogram of CPU burst time frequencies

  22. CPU scheduling algorithms (i) • CPU scheduling requires an algorithm todetermine which process to dispatch next • Scheduling algorithms include: • First-Come, First-Served (FCFS) • Shortest-Job-First (SJF) • Round-Robin (RR) • Priority • Multilevel Queue (MQ)

  23. process CPU scheduling algorithms (ii) • Preemptive scheduling preempts a running process before itstime slice expires • Or it preempts a processbecause its time slice has expired • Non-preemptive scheduling gives a process exclusive uninterrupted access to the CPU for the entirety of its execution process process process

  24. CPU scheduling algorithms (iii) • Compare scheduling algorithms by measuring • CPU utilization – keep CPU as busy as possible • Throughput – maximize the number of processes that complete their execution per unit time • Turnaround time – minimize the elapsed time to fully execute a particular process • Waiting time – minimize the elapsed time a process waits in the ready queue

More Related