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: 103376,470e89e7a6575920 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Periodic tasks - organization Date: Sun, 20 Jul 2008 10:46:45 +0100 Organization: Pushface Message-ID: References: <86589099-2e4e-4b7d-ace0-6f1f864a3fa2@y21g2000hsf.googlegroups.com> <6e0jbhF4o43oU1@mid.individual.net> <561c8fa7-f26d-49a3-b54c-229c20462c04@r66g2000hsg.googlegroups.com> <2172d1a7-39a7-412c-9f30-635054f9103d@q24g2000prf.googlegroups.com> <1jt6gtl169krz.1g52yb1id2u85$.dlg@40tude.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.demon.co.uk 1216547205 15139 62.49.19.209 (20 Jul 2008 09:46:45 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sun, 20 Jul 2008 09:46:45 +0000 (UTC) Cancel-Lock: sha1:gIyy6lGdXBsFHdWoFgIxCvxCd/0= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2.50 (darwin) Xref: g2news1.google.com comp.lang.ada:1228 Date: 2008-07-20T10:46:45+01:00 List-Id: "Dmitry A. Kazakov" writes: > On Fri, 18 Jul 2008 08:31:29 -0700 (PDT), Anh Vo wrote: > >> On Jul 17, 12:31�pm, Simon Wright wrote: > >>> But there are limits on what is permissible within a protected >>> procedure, are there not? > > [...] > >> My design is completely different from yours. Indeed, an explicit >> task is not needed. See Gem #15, Timers, for details. >> http://www.adacore.com/2007/10/29/ada-gem-15/ > > Hmm, but it is exactly the design presented by Simon. The problem with > it is that the action fired upon a timer event is called from a > protected procedure. > > This is IMO not what Maciej wanted, because as Simon has pointed out > protected procedures are very limited in what they allowed do and in > how they do it. And further, they are called at interrupt priority (I haven't read up enough to understand D-15 14/2, but see 25/2: 'executed directly by the real-time clock interrupt mechanism'), so there are going to be interesting issues related to shared variable access. If you aren't running on an RTOS, why are you bothering with the added complexity? and if you are, won't the standard Ada mechanisms (delay until, etc) do the trick? (they do for us with VxWorks). I don't quite buy the notion that RTOS => use timers (at least, not without supporting them as a variation on the general notion of event, so that some events can be scheduled to happen in the furure). Some thoughts on this here -- http://coldframe.sourceforge.net/coldframe/event-modelling.html