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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!v25g2000yqk.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Private or public task ? Date: Tue, 9 Feb 2010 04:07:14 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <38a0a3f9-b4a0-48f3-98c9-63b03fe03aca@q4g2000yqm.googlegroups.com> NNTP-Posting-Host: 77.198.58.172 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1265717234 21569 127.0.0.1 (9 Feb 2010 12:07:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 9 Feb 2010 12:07:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v25g2000yqk.googlegroups.com; posting-host=77.198.58.172; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9029 Date: 2010-02-09T04:07:14-08:00 List-Id: On 8 f=E9v, 18:28, Maciej Sobczak wrote: > As far as I understand, there is a careful wording around this subject > so that formally speaking protected operations (except for entries) > are not themselves "blocking". So, for example, you can call protected > operations from other protected operations. > > The operations that are considered to be blocking in this context are > delay statements, entry calls, select statements and... I/O > operations. These cannot be called from protected operations. > > (I'm sure somebody will correct me if I'm off tracks) Protected types was most the subject of another thread, but as you talked about it here : I don't understand why you've protected operation (I suppose you were talking about procedures, not entries) are not themselves blocking. They grant exclusive read-write access and ensure there is no race. So if another task is currently running the procedure of a protected type, another task cannot enter this procedure if it was to do so and a task switch occurs at the same time. Or is it guaranteed that no task switch can occurs when a task is actually in a procedure of a protected type ? Is the task switch delayed in such a circumstance ? Let temporarily suppose so. But remains another wolf in the wood : what if the application is running in a multiprocessors environment and its thread are not executed on the same CPU ? If one task on CPU#1 was to enter a procedure of a protected object while a task on CPU#2 is actually running a procedure on the same protected object, then, the task running on CPU#1 must be delayed, and thus, the procedure is blocking. Sure a procedure of a protected type or object should be short and quick to execute, but it seems to still remains potentially blocking.