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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC 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!news3.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.bawue.net!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Designing Timers using Ada.Real_Time.Timing_Events package Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1143317010.868435.251190@v46g2000cwv.googlegroups.com> Date: Sat, 25 Mar 2006 21:58:17 +0100 Message-ID: <1d4yew2i587h5.1h8dilwbda4zv.dlg@40tude.net> NNTP-Posting-Date: 25 Mar 2006 21:58:12 MET NNTP-Posting-Host: cd6ab38b.newsread2.arcor-online.net X-Trace: DXC=ol`K;j\VEk?_78OXD477\?Q5U85hF6f;4jW\KbG]kaM8DAHcn;Zl5e8@;Zl9Ma5E84[6LHn;2LCV>[ On 25 Mar 2006 12:03:30 -0800, Anh Vo wrote: [...] > I would like to know if I used Timing_Events package correctly in term > of its purpose. Secondly, is there any thing that these timers packages > can be improved. Thank you in advance for your thoughts. You can also use protected objects functionality rather than turn to callbacks (which are always difficult to get right in presence on multiple tasks.) A protected object may act as an waitable event triggered by the timer via a call to its protected procedure and reset in its entry point "Wait." This would be deadlock-free because anything the waiting task should do upon the event would happen outside the protected action. In a separate package you could wrap the task and the protected object in a abstract limited tagged type with the primitive operation "On_Event" to override (if you definitely want callbacks.) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de