ArticleslgStudy

computer science

Stack resource policy

Stack resource policy 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 Stack resource policy rather than just read about it. In short: The Stack Resource Policy (SRP) is a resource allocation policy used in real-time computing, used for accessing shared resources when using earliest deadline first scheduling. It was defined by T.

Key takeaways

  • Stack resource policy 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 Stack resource policy to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Stack resource policy from memory before moving on to harder problems.

Reference excerpt

The Stack Resource Policy (SRP) is a resource allocation policy used in real-time computing, used for accessing shared resources when using earliest deadline first scheduling. It was defined by T. P. Baker. SRP is not the same as the Priority ceiling protocol which is for fixed priority tasks (FP).

Function Each task is assigned a preemption level based upon the following formula where D ( T i ) {\displaystyle D(T_{i})} denotes the deadline of task i {\displaystyle i} and π i ( T i ) {\displaystyle \pi _{i}(T_{i})} denotes the preemption level of task i:

D ( T i ) < D ( T j ) ⟺ π i ( T i ) > π i ( T j ) {\displaystyle D(T_{i})<D(T_{j})\iff \pi _{i}(T_{i})>\pi _{i}(T_{j})}

Each resource R has a current ceiling C R ( V R ) {\displaystyle C_{R}(V_{R})} that represents the maximum of the preemption levels of the tasks that may be blocked, when there are V {\displaystyle V} units of R {\displaystyle R} available and μ R ( J ) {\displaystyle \mu _{R}(J)} is the maximum units of R {\displaystyle R} that T i {\displaystyle T_{i}} may require at any one time. C R ( V R ) {\displaystyle C_{R}(V_{R})} is assigned as follows:

C R ( V R ) = m a x ( { 0 } ∪ { π ( J ) | V R < μ R ( J ) } ) {\displaystyle C_{R}(V_{R})=max(\{0\}\cup \{\pi (J)|V_{R}<\mu _{R}(J)\})}

There is also a system ceiling π ′ {\displaystyle \pi '} which is the maximum of all current ceilings of the resources.

π ′ = m a x ( { C R ( i ) | i = 1 , . . . , m } ∪ { π ( J c ) } ) {\displaystyle \pi '=max(\{C_{R}(i)|i=1,...,m\}\cup \{\pi (J_{c})\})}

Any task T i {\displaystyle T_{i}} that wishes to preempt the system must first satisfy the following constraint:

π ′ < P i ( T i ) {\displaystyle \pi '<P_{i}(T_{i})}

This can be refined for Operating System implementation (as in MarteOS) by removing the multi-unit resources and defining the stack resource policy as follows

All tasks are assigned a preemption level, in order to preserve the ordering of tasks in relation to each other when locking resources. The lowest relative deadline tasks are assigned the highest preemption level. Each shared resource has an associated ceiling level, which is the maximum preemption level of all the tasks that access this protected object. The system ceiling, at any instant in time, is the maximum active priority of all the tasks that are currently executing within the system. A task is only allowed to preempt the system when its absolute deadline is less than the currently executing task and its preemption level is higher than the current system ceiling.

Relevancy The 2011 book Hard Real-Time Computing Systems: Predictable Scheduling Algorithms and Applications by Giorgio C. Buttazzo featured a dedicated section to reviewing SRP from Baker 1991 work.

References

Worked examples

Example 1 — a first encounter with Stack resource policy

Start with the simplest possible case. Write down what Stack resource policy 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 Stack resource policy 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 Stack resource policy 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 Stack resource policy

In research
Stack resource policy 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 Stack resource policy 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
Stack resource policy is common in secondary-school and first-year university syllabi. It links to neighbouring topics Real-time computing, so understanding it makes those chapters shorter.
In everyday life
Look for Stack resource policy 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 Stack resource policy in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Stack resource policy 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 Stack resource policy out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Stack resource policy in simple terms?

The Stack Resource Policy (SRP) is a resource allocation policy used in real-time computing, used for accessing shared resources when using earliest deadline first scheduling. It was defined by T.

Why does Stack resource policy 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 Stack resource policy?

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 Stack resource policy.

Tags

  • Real-time computing

Keep exploring