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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: multiple delay alternative Date: Tue, 6 Mar 2018 07:03:40 +0100 Organization: Adalog Message-ID: References: <90838aa0-bd51-4913-b0cf-1ded5024c151@googlegroups.com> <652df156-cec8-4417-ac0c-bed50c163a86@googlegroups.com> NNTP-Posting-Host: XdjV4tYMtFfMKGpv0MuDzQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Content-Language: fr X-Notice: Filtered by postfilter v. 0.8.3 Xref: reader02.eternal-september.org comp.lang.ada:50830 Date: 2018-03-06T07:03:40+01:00 List-Id: Le 06/03/2018 à 02:50, Mehdi Saada a écrit : > Before that, one thing I can't get, even after asking other people: > for protected objects, in a protected procedure, when it's blocked, > because a reading (protected function) or an entry is being served, > are the calls to the procedure put on a queue as with entries ? > Someone said me the advantage of protected procedures was that you > don't have to wait, but I read also they were exclusive with each > others... damn. This is kind of subtle. >From the formal (i.e. lawyer) POV: Queues are not required by the language. On a multi-processor, one processor could be actively looping on a lock until the lock is released. OTOH, if you are using the Ceiling_Locking locking policy on a mono-processor, the management of priorities is sufficient to guarantee exclusive access without requiring queues. The important point is that the time a task is blocked waiting on the lock can be computed. Hence the ban on "potentially blocking operations" in protected operations. >From the implementation POV: Nothing prevents an implementation from using a conventional queue of tasks waiting for the protection lock. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr