ArticleslgStudy

computer science

Pinwheel scheduling

Pinwheel scheduling is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Pinwheel scheduling rather than just read about it. In short: In mathematics and computer science, the pinwheel scheduling problem is a problem in real-time scheduling with repeating tasks of unit length and hard constraints on the time between repetitions. When a pinwheel scheduling problem has a solution, it has one in which the schedule repeats periodically.

Pinwheel scheduling — main illustration
Pinwheel scheduling — illustration

Key takeaways

  • Pinwheel scheduling belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Pinwheel scheduling to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Pinwheel scheduling from memory before moving on to harder problems.

Reference excerpt

In mathematics and computer science, the pinwheel scheduling problem is a problem in real-time scheduling with repeating tasks of unit length and hard constraints on the time between repetitions. When a pinwheel scheduling problem has a solution, it has one in which the schedule repeats periodically. This repeating pattern resembles the repeating pattern of set and unset pins on the gears of a pinwheel cipher machine, justifying the name. If the fraction of time that is required by each task totals less than 5/6 of the total time, a solution always exists, but some pinwheel scheduling problems whose tasks use a total of slightly more than 5/6 of the total time do not have solutions. Certain formulations of the pinwheel scheduling problem are NP-hard.

Definition The input to pinwheel scheduling consists of a list of tasks, each of which is assumed to take unit time per instantiation. Each task has an associated positive integer value, its maximum repeat time (the maximum time from the start of one instantiation of the task to the next). Only one task can be performed at any given time. The desired output is an infinite sequence specifying which task to perform in each unit of time. Each input task should appear infinitely often in the sequence, with the largest gap between two consecutive instantiations of a task at most equal to the repeat time of the task. For example, the infinitely repeating sequence ABACABACABAC... would be a valid pinwheel schedule for three tasks A, B, and C with repeat times that are at least 2, 4, and 4 respectively.

Density If the task to be scheduled are numbered from 1 {\displaystyle 1} to n {\displaystyle n} , let t i {\displaystyle t_{i}} denote the repeat time for task i {\displaystyle i} . In any valid schedule, task i {\displaystyle i} must use a 1 / t i {\displaystyle 1/t_{i}} fraction of the total time, the amount that would be used in a schedule that repeats that task at exactly its specified repeat time. The density of a pinwheel scheduling problem is defined as the sum of these fractions, ∑ 1 / t i {\displaystyle \textstyle \sum 1/t_{i}} . For a solution to exist, the times devoted to each task cannot sum to more than the total available time, so it is necessary for the density to be at most 1 {\displaystyle 1} . This condition on density is also sufficient for a schedule to exist in the special case that all repeat times are multiples of each other. For instance, this would be true when all repeat times are powers of two. In this case one can solve the problem using a disjoint covering system. Having density at most 1 {\displaystyle 1} is also sufficient when there are exactly two distinct repeat times. However, having density at most 1 is not sufficient in some other cases. In particular, there is no schedule for three items with repeat times t 1 = 2 {\displaystyle t_{1}=2} , t 2 = 3 {\displaystyle t_{2}=3} , and t 3 {\displaystyle t_{3}} , no matter how large t 3 {\displaystyle t_{3}} may be, even though the density of this system is only 5 / 6 + 1 / t 3 {\displaystyle 5/6+1/t_{3}} . In 1993, it was conjectured that, when the density of a pinwheel scheduling is at most 5 / 6 {\displaystyle 5/6} , a solution exists. This was proven in 2024.

Periodicity and complexity When a solution exists, it can be assumed to be periodic, with a period at most equal to the product of the repeat times. However, it is not always possible to find a repeating schedule of sub-exponential length. With a compact input representation that specifies, for each distinct repeat time, the number of objects that have that repeat time, pinwheel scheduling is NP-hard.

… excerpt ends here. Continue reading the full article.

Illustrations

Pinwheel scheduling: An instance of the pinwheel scheduling problem: tasks A, B, and C have maximum repeat times 2, 4, and 5 respectively. The repeating schedule ABACABAC... solves this instance.
An instance of the pinwheel scheduling problem: tasks A, B, and C have maximum repeat times 2, 4, and 5 respectively. The repeating schedule ABACABAC... solves this instance.
Pinwheel scheduling: A pinwheel in a Lorenz SZ42 cipher machine with its pins (the small lugs near the center of the image) set to different positions
A pinwheel in a Lorenz SZ42 cipher machine with its pins (the small lugs near the center of the image) set to different positions

Worked examples

Example 1 — a first encounter with Pinwheel scheduling

Start with the simplest possible case. Write down what Pinwheel scheduling claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Pinwheel scheduling before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Pinwheel scheduling ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Pinwheel scheduling

In research
Pinwheel scheduling appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Pinwheel scheduling in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Pinwheel scheduling is common in secondary-school and first-year university syllabi. It links to neighbouring topics Processor scheduling algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Pinwheel scheduling outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Pinwheel scheduling in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Pinwheel scheduling means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Pinwheel scheduling out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Pinwheel scheduling in simple terms?

In mathematics and computer science, the pinwheel scheduling problem is a problem in real-time scheduling with repeating tasks of unit length and hard constraints on the time between repetitions. When a pinwheel scheduling problem has a solution, it has one in which the schedule repeats periodicall…

Why does Pinwheel scheduling matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Pinwheel scheduling?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Pinwheel scheduling.

Tags

  • Processor scheduling algorithms

Keep exploring