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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5b15c37c5d0c986f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!i40g2000cwc.googlegroups.com!not-for-mail From: "Anh Vo" Newsgroups: comp.lang.ada Subject: Re: Designing Timers using Ada.Real_Time.Timing_Events package Date: 26 Mar 2006 08:18:56 -0800 Organization: http://groups.google.com Message-ID: <1143389936.844624.243020@i40g2000cwc.googlegroups.com> References: <1143317010.868435.251190@v46g2000cwv.googlegroups.com> <1d4yew2i587h5.1h8dilwbda4zv.dlg@40tude.net> <1143351567.528574.297850@z34g2000cwc.googlegroups.com> <1fiau0e4pe84o$.gulfgysczk5i$.dlg@40tude.net> NNTP-Posting-Host: 71.146.81.142 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1143389943 31053 127.0.0.1 (26 Mar 2006 16:19:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 26 Mar 2006 16:19:03 +0000 (UTC) In-Reply-To: <1fiau0e4pe84o$.gulfgysczk5i$.dlg@40tude.net> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: i40g2000cwc.googlegroups.com; posting-host=71.146.81.142; posting-account=JVr7Xg0AAAAI3MbuARxMmvWLmA7qdJMx Xref: g2news1.google.com comp.lang.ada:3630 Date: 2006-03-26T08:18:56-08:00 List-Id: >> I did not know that it is possible to use protected objects >> functionally while each timer used for different purpose. Could you >> elaborate further? > Why not? Each protected object would be a simple event. The handler set for > Ada.Real_Time.Timing_Events triggers an event(s). The functionality, i.e. > what has to be done upon the event, is outside. It happens in the task > waiting for the event. it works only if there is a specific purpose associated with an event. In other word, an event handler must be set for a specific action. The timers work almost like a generic in that the event is set once. The action is supplied at the time of instantiation. > (I don't have GNAT GPL installed) GNAT GPL has not implemented Timing_Events yet. GNAT under gcc-4.2.0 is needed. > Decoupling. The model one task - one callback is too specialized and > exposed to misuse. You might wish to have more than one task, you might > want handling the timer events on different contexts, routing and > re-routing them between tasks. For each timer defined through derivation, it is run under a separate task. In case of Safe_Timers there are two tasks, additional task needed for decoupling, running. Therefore, they are completely separated between callbacks. AV