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-Thread: a07f3367d7,385c146dd3112519 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Path: g2news1.google.com!postnews.google.com!a32g2000yqm.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: Fri, 5 Feb 2010 14:09:33 -0800 (PST) Organization: http://groups.google.com Message-ID: <494a3592-421b-4a08-9505-f4c9b2cdce43@a32g2000yqm.googlegroups.com> References: <1rvjt99u2jqa8.1okqcvf62hlc8$.dlg@40tude.net> NNTP-Posting-Host: 86.75.149.60 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1265407773 11736 127.0.0.1 (5 Feb 2010 22:09:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 5 Feb 2010 22:09:33 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a32g2000yqm.googlegroups.com; posting-host=86.75.149.60; 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:8924 Date: 2010-02-05T14:09:33-08:00 List-Id: On 5 f=E9v, 22:40, "Dmitry A. Kazakov" wrote: > This is illegal, because protected procedure shall not perform potentiall= y > blocking actions (like I/O. As Jeffrey pointed out as well. I will check the RM about it (I have to establish I've missed it). > You do not need to worry about that. Unless you are using pointers, the > task object's scope encloses any calls to its entries. Therefore it simpl= y > cannot terminate due to its finalization before any entry call. **it simply cannot terminate due to its finalization before any entry call** That's clever to notice ! OK, I see. Now I understand Jeffrey's doubts. > If you want garbage collection because of pointers involved then just do > it. Don't break the task interface, make a handle type pointing to the ta= sk > object. When the last handle vanishes, deallocate the task. That is. =93 Deallocate the task =94 ? If I want to deallocate, I have to request it to completes, and for the latter, I need it to have a corresponding request entry... which would need to be public (as private entry accessible from implementation is not possible). > Task component does not work in most real-life cases. My words was wrong : I was not to talk about using task as record components, I was to say task may be implementation details, just like record components are. > Yes, an entry call can be syntactically and semantically different than a > call to a procedure. Syntactically : can be wrapped in a procedure call. Semantically : sure if protected objects are required to not invoke blocking operations, this is semantically different. > You can print from the rendezvous. That is not a problem. Some tight > implementations would prefer buffering in the rendezvous in order to > release the caller as soon as possible (minimizing the effect of priority > inversion). I.e. Text is first copied into the task's buffer during the > rendezvous and printed later outside the rendezvous before accepting the > new one. Assuming that the callers run at a higher priority and do not > print very often leaving the processor free most of the time, this would > give better response times in the callers (at the cost of some overall > performance hit). I like this hint (have a taste of real-time design by the way).