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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,20139b0dc49ad74b,start X-Google-Attributes: gid103376,public From: Moti Ben-Ari Subject: Semantics of requeue Date: 1996/09/08 Message-ID: <3232697C.2A5C@wis.weizmann.ac.il>#1/1 X-Deja-AN: 179216569 sender: news@wisipc.weizmann.ac.il (News User) content-type: text/plain; charset=us-ascii organization: Weizmann Institute of Science mime-version: 1.0 reply-to: ntbenari@wis.weizmann.ac.il newsgroups: comp.lang.ada x-mailer: Mozilla 3.0b8Gold (Win95; I) Date: 1996-09-08T00:00:00+00:00 List-Id: I have a question on the semantics of requeue: When a requeue is done on an "internal" entry of a protected object, it is clear that the caller is queued as part of the "on-going protected action" (LRM 9.5.4(10)). This prevents nasty race conditions, as shown in many published examples of concurrent programs written in Ada 95. However, I am uncertain exactly what is supposed to happen when a requeue is done on an entry of another protected object or on an entry of a task. Specifically, suppose task T1 executing PO.E requeues on entry T2.E. Is it possible that between the end of the protected action PO.E, and the (re-)queueing of the caller T1 on the entry T2.E, another task T3 could execute T2.E and "jump the queue" (assuming default FIFO scheduling)? LRM 9.5.4(7-8) says: 7 ... The entry_body or accept_statement enclosing the requeue_statement is then completed, finalized, and left (see 7.6.1). 8 For the execution of a requeue on an entry of a target task, after leaving the enclosing callable construct, ... the requeued call is either selected immediately or queued, as for a normal entry call (see 9.5.3). Thus I am asking: are paragraphs 7-8 part of a single atomic statement, or can the scheduler preempt a task between 7 and 8. Thanks Moti Ben-Ari Dr. Mordechai (Moti) Ben-Ari Dept. of Science Teaching, Weizmann Institute of Science Rehovot 76100 Israel, Tel: 972-8-934-2940. Fax: 972-8-934-4174. ntbenari@wis.weizmann.ac.il