CPU Cycle and its Relation to Time

Relation to Clock Speed

Key Takeaways


Overview

Key Concepts

  1. Priority-based Queues:

    • Different queues exist for various priority levels.
    • Higher-priority queues receive CPU time before lower-priority ones.
  2. CPU-bound vs. I/O-bound Queues:

    • Separate queues for CPU-intensive and I/O-intensive tasks.
    • The scheduler alternates between queues to maintain system balance.
  3. Foreground vs. Background Queues:

    • Interactive (foreground) jobs are given preferential treatment.
    • Batch (background) jobs are processed with lower priority.

Characteristics


Questions to Consider

  1. Queue Traversal:

    • Should the processor finish all jobs in one queue before moving to the next?
    • Or should it cycle through queues?
  2. Fairness:

    • Is it fair to favor high-priority jobs excessively?
    • Will low-priority jobs get an opportunity to execute?
  3. Starvation Prevention:

    • How can jobs in lower-priority queues eventually be served?
    • Can aging or queue promotions improve fairness?

Queue Movement Policies

  1. Fixed Queues:

    • Jobs remain in their assigned queues throughout execution.
  2. Dynamic Movement:

    • Jobs are moved between queues based on performance or behavior.
  3. Increasing Time Quantums:

    • Lower-priority queues may have larger time quantums to balance execution time.
  4. Aging:

    • Jobs waiting too long are promoted to higher-priority queues.

Advantages

Challenges


Notes on Availability and Reliability

Key Definitions:

  1. Availability:

    • A measure of the time a unit is operational and available for use.
    • Influenced by:
      • MTBF (Mean Time Between Failures): Average operational time before failure.
      • MTTR (Mean Time to Repair): Average time to repair and return the unit to service.
    • Formula: [ \text{Availability} = \frac{\text{MTBF}}{\text{MTBF} + \text{MTTR}} ]
    • Example Calculation:
      • MTBF: 4,000 hours
      • MTTR: 2 hours
      • [ \text{Availability} = \frac{4000}{4000 + 2} = 0.9995 ]
      • Interpretation: The unit would be available 99.95% of the time, or 9,995 out of every 10,000 hours.
  2. Reliability:

    • A measure of the probability that a unit will not fail during a given time period.

    • Formula (introduced by Nickel in 1978): [ \text{Reliability}(t) = e^{-\frac{1}{\text{MTBF}} \cdot t} ]

      • ( e ): Mathematical constant (approximately 2.71828).
      • ( t ): Time period (in the same units as MTBF).
    • Example Calculation:

      • MTBF: 4,000 hours
      • Time (t): 10 minutes = ( \frac{10}{60} ) hours
      • [ \text{Reliability}(t) = e^{-\frac{1}{4000} \cdot \frac{10}{60}} ]
      • Simplification: [ \text{Reliability}(t) = e^{-\frac{1}{24,000}} \approx 0.9999584 ]
      • Interpretation: The unit has a 99.99584% probability of functioning during the required 10-minute period.

Key Considerations:


Practical Examples:

  1. Terminal Example:

    • MTBF: 4,000 hours.
    • Usage: 4 hours/day, 20 days/month = 80 hours/month.
    • Failure Frequency: [ \text{Failure Interval} = \frac{\text{MTBF}}{\text{Usage}} = \frac{4000}{80} = 50 \text{ months} ]
  2. Deadline Scenario:

    • If a unit must work for 10 minutes before a deadline:
      • Reliability ≈ 99.99584%.

Written by A.M. Rinas