• No results found

Supporting Interacting Tasks within a Component

Rate-Based Resource Allocation Methods

5.6 Schedulable Workload Utilization Bounds

5.7.2 Supporting Interacting Tasks within a Component

Until now, we have addressed the component abstraction problem under the assumption that the tasks of a component are independent, i.e., they can execute in any order. In many real-time systems, data and control dependencies among tasks may constrain the order in which they can execute. For example, in a radar surveillance system, the signal-processing task is the producer of track records, while the tracker task is the consumer. There are two approaches for supporting data dependencies between the producer and consumer tasks.

One approach is to place the precedence constraint between the producer and consumer tasks so that a consumer job synchronize with the corresponding producer job(s) and wait until the latter completes to execute.

The other approach is not to synchronize producer and consumer tasks. Rather, each producer places the data generated by it in a shared address space to be used by the consumer at any time. In this case, the producer and consumer are independent because they are not explicitly constrained to execute in turn. In this approach, a problem of data integrity can happen between data producer and consumer tasks running at different rates. The data integrity problem exists when the input to a data consumer task changes during the execution of that task. For example, a faster producer task supplies the input to a slower consumer task. The slower consumer reads an input value v1from the faster producer and begins computations using that value. The computation are preempted by another execution of the faster producer, which computes a new output value v2. A data integrity problem now arises: when the slower consumer resumes execution, it continues its computations, now using the “new” input value v2.

Here, we briefly examine an approach, namely, the RTW approach, that can resolve the data integrity problem in real-time data transfer between the producer and consumer tasks with different periods.

RTW is a tool for automatic code generation in the MATLAB/Simulink environment [19]. The tool addresses the data integrity problem by placing race transition blocks, hold or delay blocks, between the

T1 p1 20 T2 p2 40 h T1 p1 20 T3 p3 10 d (a) (b)

FIGURE 5.9 Data producer and consumer tasks in the RTW model: (a) with a hold block and (b) with a delay block.

data producer and consumer tasks of different periods, under the restriction that the periods of producer and consumer tasks should be harmonic. The tool assumes that a priority-based preemption mechanism will be used for task execution. Figure 5.9 shows an example of adding hold and delay blocks.

A hold block is inserted between a faster producer task T1and a slower consumer task T2, for guaran- teeing that the input value of T2from T1does not change during the execution of T2. The hold block has the same period of T2but is a higher-priority task than T2, so that it reads the latest output value of T1 before T2executes and holds it until T2finishes executing.

A delay block is used for the inverse case, being inserted between a slower producer task T1and a faster consumer task T3. The delay block has the same period of T1but is a higher-priority task than T1, for ensuring that no matter when T1finishes, the delay block does not overwrite the input value of T3during the execution of T3.

Resolving the data integrity problem between the producer and consumer tasks using the hold and delay blocks, the RTW approach inherently allows these producer and consumer tasks to treat as independent tasks. That is, even though a component C consists of interacting tasks with data dependency, the com- ponent C can be treated as consisting of only independent tasks. Assuming the negligible execution times of the hold and delay blocks, Matic and Henzinger [20] have showed that our proposed framework can be used for abstracting the component C. In addition to the RTW approach, they have also showed that another approach, namely, the LET approach [11], can be used for supporting interacting tasks with data dependencies and that our proposed framework can be used with LET for abstracting components with the interacting tasks.

5.8 Conclusions

In this chapter, we have considered the problem of analyzing the schedulability of hierarchical scheduling systems through component abstraction and composition. We gave schedulability conditions and utiliza- tion bounds for a periodic tasks under EDF and RM scheduling over the bounded-delay resource model and the periodic resource model.

In this chapter, we have considered only hard real-time resource models. For future research, it will be interesting to investigate soft real-time resource models for hierarchical scheduling systems. Soft real-time task models such as the (m, k)-firm deadline model [10] and the weakly hard task model [3] can be a good basis for the development of soft real-time resource models.

References

1. L. Almeida and P. Pedreiras. Scheduling within temporal partitions: response-time analysis and server design. In Proc. of the Fourth ACM International Conference on Embedded Software, September 2004.

2. S. Baruah, A. Mok, and L. Rosier. Preemptively scheduling hard-real-time sporadic tasks on one processor. In Proc. of IEEE Real-Time Systems Symposium, pp. 182–190, December 1990.

3. G. Bernat, A. Burns, and A. Llamosi. Weakly hard real-time systems. IEEE Transactions on Computers, 50(4): 308–321, 2001.

4. R. I. Davis and A. Burns. Hierarchical fixed priority pre-emptive scheduling. In Proc. of IEEE Real-Time Systems Symposium, December 2005.

5. L. de Alfaro and T. A. Henzinger. Interface automata. In Proc. of the Ninth Annual Symposium on Foundations of Software Engineering. ACM Press, New York, NY, USA, 2001.

6. L. de Alfaro and T. A. Henzinger. Interface theories for component-based design. In Proc. of the First International Workshop on Embedded Software, pp. 148–165. Lecture Notes in Computer Science 2211, Springer, Berlin, 2001.

7. Z. Deng and J. W.-S. Liu. Scheduling real-time applications in an open environment. In Proc. of IEEE Real-Time Systems Symposium, pp. 308–319, December 1997.

8. X. Feng and A. Mok. A model of hierarchical real-time virtual resources. In Proc. of IEEE Real-Time Systems Symposium, pp. 26–35, December 2002.

9. P. Goyal, X. Guo, and H. M. Vin. A hierarchical CPU scheduler for multimedia operating systems. In Usenix Association Second Symposium on Operating Systems Design and Implementation (OSDI), pp. 107–121, 1996.

10. M. Hamdaoui and P. Ramanathan. A dynamic priority assignment technique for streams with (m, k)-firm deadlines. IEEE Transactions on Computers, 44(12): 1443–1451, 1995.

11. T. A. Henzinger, B. Horowitz, and C. M. Kirsch. Giotto: a time-triggered language for embedded programming. Proceedings of IEEE, 91: 84–99, 2003.

12. T. A. Henzinger and S. Matic. An interface algebra for real-time components. In Proc. of IEEE Real-Time Technology and Applications Symposium, pp. 253–263, April 2006.

13. T.-W. Kuo and C. H. Li. A fixed-priority-driven open environment for real-time applications. In Proc. of IEEE Real-Time Systems Symposium, pp. 256–267, December 1999.

14. J. Lehoczky, L. Sha, and Y. Ding. The rate monotonic scheduling algorithm: exact characteri- zation and average case behavior. In Proc. of IEEE Real-Time Systems Symposium, pp. 166–171, 1989.

15. G. Lipari and S. Baruah. Efficient scheduling of real-time multi-task applications in dynamic systems. In Proc. of IEEE Real-Time Technology and Applications Symposium, pp. 166–175, May 2000.

16. G. Lipari and E. Bini. Resource partitioning among real-time applications. In Proc. of Euromicro Conference on Real-Time Systems, July 2003.

17. G. Lipari, J. Carpenter, and S. Baruah. A framework for achieving inter-application isolation in multi-programmed hard-real-time environments. In Proc. of IEEE Real-Time Systems Symposium, December 2000.

18. C. L. Liu and J. W. Layland. Scheduling algorithms for multi-programming in a hard-real-time environment. Journal of the ACM, 20(1): 46–61, 1973.

19. Mathworks. Models with multiple sample rates. In Real-Time Workshop User Guide, pp. 1–34. The MathWorks Inc., Natick, MA, USA, 2005.

20. S. Matic and T. A. Henzinger. Trading end-to-end latency for composability. In Proc. of IEEE Real-Time Systems Symposium, pp. 99–110, December 2005.

21. A. Mok, X. Feng, and D. Chen. Resource partition for real-time systems. In Proc. of IEEE Real-Time Technology and Applications Symposium, pp. 75–84, May 2001.

22. A. K. Mok and X. Feng. Towards compositionality in real-time resource partitioning based on regularity bounds. In Proc. of IEEE Real-Time Systems Symposium, pp. 129–138, December 2001. 23. J. Regehr and J. Stankovic. HLS: a framework for composing soft real-time schedulers. In Proc. of

IEEE Real-Time Systems Symposium, pp. 3–14, December 2001.

24. S. Saewong, R. Rajkumar, J. P. Lehoczky, and M. H. Klein. Analysis of hierarchical fixed-priority scheduling. In Proc. of Euromicro Conference on Real-Time Systems, June 2002.

25. I. Shin and I. Lee. Periodic resource model for compositional real-time guarantees. In Proc. of IEEE Real-Time Systems Symposium, pp. 2–13, December 2003.

26. I. Shin and I. Lee. Compositional real-time scheduling framework. In Proc. of IEEE Real-Time Systems Symposium, December 2004.

27. I. Shin and I. Lee. Compositional real-time scheduling framework. Technical report, MS-CIS-04-20, University of Pennsylvania, 2004.

28. I. Shin. Compositional framework for real-time embedded systems. Ph.D. thesis, University of Pennsylvania, Philadelphia, PA, USA, 2006.

29. E. Wandeler and L. Thiele. Real-time interface for interface-based design of real-time systems with fixed priority scheduling. In Proc. of the Fifth ACM International Conference on Embedded Software (EMSOFT ’05), pp. 80–89, October 2005.

30. E. Wandeler and L. Thiele. Interface-based design of real-time systems with hierarchical scheduling. In Proc. of IEEE Real-Time Technology and Applications Symposium, pp. 243–252, April 2006.

6