From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,96fc7f1e397aab8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-02 08:52:15 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.mailgate.org!skynet.be!skynet.be!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr11.news.prodigy.com.POSTED!not-for-mail From: "Pat Rogers" Newsgroups: comp.lang.ada References: <9b051957.0209020707.562bdac4@posting.google.com> Subject: Re: Ceiling priority and priority inversion X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <9OLc9.12727$6U1.3212496070@newssvr11.news.prodigy.com> NNTP-Posting-Host: 208.191.182.164 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr11.news.prodigy.com 1030981893 ST000 208.191.182.164 (Mon, 02 Sep 2002 11:51:33 EDT) NNTP-Posting-Date: Mon, 02 Sep 2002 11:51:33 EDT Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: FKPO@MONFJVMQVPXJZDBNFXBBZ\LPCXLLBWLOOAF@YUDUWYAKVUOPCW[ML\JXUCKVFDYZKBMSFX^OMSAFNTINTDDMVW[X\THOPXZRVOCJTUTPC\_JSBVX\KAOTBAJBVMZTYAKMNLDI_MFDSSOLXINH__FS^\WQGHGI^C@E[A_CF\AQLDQ\BTMPLDFNVUQ_VM Date: Mon, 02 Sep 2002 15:51:33 GMT Xref: archiver1.google.com comp.lang.ada:28658 Date: 2002-09-02T15:51:33+00:00 List-Id: "Mathias" wrote in message news:9b051957.0209020707.562bdac4@posting.google.com... > I an pretty new with Ada and wonder if someone out there can help me clarify > how the pragma Locking_Policy(Ceiling_Priority) works. > Let's say for an example that the protected object is a buffer shared > between a number of tasks, among which one is a low priority application > task and another is an interrupt handler. Using Ceiling_Priority will cause > all tasks executing within the protected object do so with interrupt > priority. Doesn't this potentially cause a kind of priority inversion? When > the application task executes within the buffer it preempts all other tasks > in the system, even interrupts. Interrupts at that level or below, yes. With the design you describe, that's what you want -- while the accessing task is within the PO you don't want another of those interrupts to be handled and you don't want any other tasks accessing the encapsulated data within the PO. That's probably OK since interrupt handlers should be short and sweet. > Shouldn't it instead work like the following? If a low priority task is > executing within a protected object and a task with a higher priority tries > to gain access this object. Then the low priority task should be raised to > the priority level of the waiting task. But if there is no concurrent access > the low priority task executes with its base priority. Ada uses the *Immediate* Ceiling Priority Protocol, because it is more efficient to implement. -- Patrick Rogers Consulting and Training in: http://www.classwide.com Real-Time/OO Languages progers@classwide.com Hard Deadline Schedulability Analysis (281)648-3165 Software Fault Tolerance