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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.140.30.99 with SMTP id c90mr3814496qgc.2.1458787066281; Wed, 23 Mar 2016 19:37:46 -0700 (PDT) X-Received: by 10.157.17.33 with SMTP id g30mr66589ote.7.1458787066139; Wed, 23 Mar 2016 19:37:46 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!1.us.feeder.erje.net!feeder.erje.net!2.us.feeder.erje.net!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!y89no9108423qge.0!news-out.google.com!u9ni4690igk.0!nntp.google.com!nt3no3991909igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 23 Mar 2016 19:37:45 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8201:bb5a:5985:2c17:9409:aa9c; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8201:bb5a:5985:2c17:9409:aa9c References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Asynchronous channels in Ada From: rieachus@comcast.net Injection-Date: Thu, 24 Mar 2016 02:37:46 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2326 X-Received-Body-CRC: 3228295095 Xref: news.eternal-september.org comp.lang.ada:29854 Date: 2016-03-23T19:37:45-07:00 List-Id: There is a "trick" which is very useful in certain contexts. Your program = has producer and consumer tasks, but you need occasionally to restart the c= hannel and put everything in a consistent state: declare -- queue state and exception information here. begin loop exit when... begin task Producer...; task Consumer...; exception when =3D=3D> ... end; end loop; end; Your consumer task needs to use a terminate_alternative, but it should prob= ably be doing that anyway. This is just a skeleton scaffolding, but it sho= uld get the idea across. If producer needs to signal an exception, it just= does. When the consumer starts up again, it looks to see what went wrong. Of course, if your design requires that the producer and consumer tasks be = on different hardware, or some such, then you do need a more complex soluti= on. (I spent a lot of time working on systems where a "deadman" timer going= off meant you had to get everything restarted inside so many milliseconds.= ;-) You do not want one too many threats to cause the aircraft's controls= to lock up.