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-Thread: 103376,eed7a24b26e16574 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!w1g2000prk.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Quick Protected Object question Date: Mon, 8 Dec 2008 05:43:37 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <7d83cfa9-a97c-4a74-8202-c15035d607fa@j39g2000yqn.googlegroups.com> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1228743817 13623 127.0.0.1 (8 Dec 2008 13:43:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 8 Dec 2008 13:43:37 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w1g2000prk.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20070718 Red Hat/1.5.0.12-3.el5 Firefox/1.5.0.12,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:2936 Date: 2008-12-08T05:43:37-08:00 List-Id: On Dec 8, 2:34 pm, markp wrote: > I have a very quick protected object question. In a standard proected > object setup as follows: > > protected Test is > procedure A; > procedure B; > private > Z : integer := 0; > end Test; > > protected body Test is > procedure A is > begin > < set of statements> > end A; > > procedure B is > begin > < set of statements> > end B; > end Test; > > The question is this: when procedure A is called, are all threads that > try to call B suspended until A finishes or, do the threads that call > B execute as long as A is not touching the private data "Z". Is the > lock at the procedure level or only at the data level? At the procedure level; see ARM 9.5.1 at http://www.adaic.com/standards/05rm/html/RM-9-5-1.html -- Ludovic Brenta.