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!z34g2000cwc.googlegroups.com!not-for-mail From: "Anh Vo" Newsgroups: comp.lang.ada Subject: Re: Designing Timers using Ada.Real_Time.Timing_Events package Date: 25 Mar 2006 21:39:27 -0800 Organization: http://groups.google.com Message-ID: <1143351567.528574.297850@z34g2000cwc.googlegroups.com> References: <1143317010.868435.251190@v46g2000cwv.googlegroups.com> <1d4yew2i587h5.1h8dilwbda4zv.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 1143351573 11575 127.0.0.1 (26 Mar 2006 05:39:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 26 Mar 2006 05:39:33 +0000 (UTC) In-Reply-To: <1d4yew2i587h5.1h8dilwbda4zv.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: z34g2000cwc.googlegroups.com; posting-host=71.146.81.142; posting-account=JVr7Xg0AAAAI3MbuARxMmvWLmA7qdJMx Xref: g2news1.google.com comp.lang.ada:3621 Date: 2006-03-25T21:39:27-08:00 List-Id: > 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. I did not know that it is possible to use protected objects functionally while each timer used for different purpose. Could you elaborate further? Or even better could you show your point with codes? > 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.) I am not sure what advantage gained for doing this way? Again, if you show me some codes which could make me understatnd better. Thanks for your suggestion. AV