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: ffc1e,fb45e48e8dddeabd X-Google-Attributes: gidffc1e,public X-Google-Thread: 103376,fb45e48e8dddeabd X-Google-Attributes: gid103376,public From: kaz@ashi.footprints.net (Kaz Kylheku) Subject: Re: Ada Protected Object Tutorial #1 Date: 1999/12/18 Message-ID: #1/1 X-Deja-AN: 562439165 Cache-Post-Path: ashi.FootPrints.net!unknown@localhost References: <839toq$pu$1@bgtnsc03.worldnet.att.net> <3858E5B3.9AB004E9@bton.ac.uk> <385984BC.1FB1@hello.nl> <86aen9z7qi.fsf@ppp-111-13.villette.club-internet.fr> <86u2lgvumy.fsf@ppp-116-44.villette.club-internet.fr> X-Complaints-To: abuse@direct.ca X-Trace: brie.direct.ca 945553232 204.239.179.1 (Sat, 18 Dec 1999 13:40:32 PST) Organization: Psycho-Neurotic Institute for The Very, Very Nervous X-Cache: nntpcache 2.3.3b3 (see http://www.nntpcache.org/) User-Agent: slrn/0.9.5.7 (UNIX) Reply-To: kaz@ashi.footprints.net NNTP-Posting-Date: Sat, 18 Dec 1999 13:40:32 PST Newsgroups: comp.programming.threads,comp.lang.ada Date: 1999-12-18T00:00:00+00:00 List-Id: On 18 Dec 1999 21:52:53 +0100, Laurent Guerby wrote: >There is no clairvoyance involved, it is just that the Ada language is >designed to allow an efficient implementation of protected >procedures. The language defines as a bounded error when potentially >blocking operation is called from a protected procedure, or when >jumping around brings you back to the original protected object. That's good. I follow the same principles generally, but without language help it's easy to make mistakes like do some blocking thing inside a tight critical section or create deadlock. What do you do if you need a protected procedure to call out into some other module which then calls back? Using explicit locks, I just unlock, do the call, lock again thereby avoiding deadlock. >See RM 9.5.1 for details. Though I don't use Ada, I have a hard copy of the standard somewhere under my desk, so I can take a look.