1 / 20

Operating Systems {week 06}

Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D. Operating Systems {week 06}. 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

bona
Télécharger la présentation

Operating Systems {week 06}

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 06}

  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. P3 P1 P2 P3 P1 P3 P1 0 2 4 6 8 10 12 13 Round-Robin (RR) • RR is a preemptive algorithmthat gives all ready processesa fair time slice of CPU time • Using a time slice of 2 ms.... time

  15. Priority Scheduling (i) • Associate a priority number with each process • The dispatcher selects the processwith the highest priority • For multiple ready processeswith identical priority values,use FCFS (or ...) • Key problem is starvation • Overcome starvation by aging, increasingthe priority of a process as it ages

  16. process Priority Scheduling (ii) • Is priority scheduling preemptiveor non-preemptive? • Non-preemptive priority scheduling places higher-priority processes at the head of the queue • Preemptive priority scheduling requires a running process to be interrupted and preempted upon the arrival of a higher-priority process (use this one for Project #1)

  17. Multiclass systems • Operating systems that support priority schemes are often called multiclass systems use a separate schedulingalgorithm for each queue

  18. Multilevel Queue (MQ) • Assign processes to multiple queues,each with its own scheduling algorithm

  19. Multilevel Feedback Queue (MFQ) • Dynamically assign processes to multiple queues based on actual CPU burst times • i.e. feedback quantum is synonymouswith time slice

  20. Practice! • Apply the FCFS, SJF, RR, and Preemptive Priority scheduling algorithms to this table: • For RR, use a time slice of 10 ms • Calculate the wait and turnaround times ofeach process, as well as overall averages lower number indicates a higher priority recalculate using context switch time tcs = 20 μs

More Related