Detection and Avoidance of Elaboration-Time Problems for Multi-Unit Real-Time Ada Applications

This paper describes three significant problems that may occur due to the elaboration order of the compilation units of a large Ada program. One concern is the possibility of access-before-elaboration errors. A second issue is priority inversion amongst library tasks—a possibly serious problem for real-time systems, for example, in the implementation of the Priority Ceiling Protocol. A third problem is elaboration-time deadlock—the situation where elaboration cannot be completed because a non-task entity calls a task entry before the activation of the task. In this paper we outline a set of coding practices which, if rigorously followed, eliminate most elaboration-time problems. Also, we briefly describe a scheme to determine a proper elaboration order on the basis of source code analysis and show how such a scheme can be used, if our coding practices are followed, to detect potential elaboration-time deadlock situations.