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 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.68.137.99 with SMTP id qh3mr1359049pbb.2.1403036063625; Tue, 17 Jun 2014 13:14:23 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!a13no6912374igq.0!news-out.google.com!a8ni8012qaq.1!nntp.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.nethere.com!news.nethere.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 17 Jun 2014 15:14:22 -0500 Newsgroups: comp.lang.ada Subject: Re: Termination of periodic tasks From: csampson@inetworld.net (Charles H. Sampson) Date: Tue, 17 Jun 2014 13:14:23 -0700 Message-ID: <1lndy96.or7wdo1tdxu58N%csampson@inetworld.net> References: MIME-Version: 1.0 User-Agent: MacSOUP/2.8.3 (Mac OS X version 10.4.11 (PPC)) X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-dHQ2f2kC+cWmSnVgMqg+B7YPf43RBUfb7gCG1I5VSR3AmpmZeMMhllDsDtVjKQKsVOmHJ1BfG3Tgvrb!WgyX58BFnnYf64xCX89Bixkb99KpVVRUaV8X3952D1mJPxW4IJd8Tf0myAc6qwH8OphPvDr4sols!Gm4ttfu9NDPBAMFugJ0+nyumM2gH1w== X-Complaints-To: abuse@nethere.com X-DMCA-Complaints-To: abuse@nethere.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2737 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Xref: news.eternal-september.org comp.lang.ada:20412 Date: 2014-06-17T13:14:23-07:00 List-Id: Natasha Kerensikova wrote: > Hello, > > On 2014-06-15, J-P. Rosen wrote: > > Le 15/06/2014 12:10, Natasha Kerensikova a écrit : > >> And same as before, the task should be able to terminate quickly when > >> the program terminates. > > Why not have a "stop" entry called by the main program when it > > terminates (possibly through an exported subprogram if you don't want to > > have the task public)? > > Mostly because I believe this to be too heavy for a burden for the > client, and somewhat of an abstraction leak. I'm having trouble understanding how this is too heavy. In most programs I've written, there's a possibility of stopping. Usually the need to stop is detected by or, most commonly, propagated to the main program. The main program then signals all of its library packages to do whatever is necessary for stopping. An exported Stop subprogram seems a quite natural way to do that. I've even used implementations that have exported Stop subprograms in all library packages, some of them null. That enforces the abstractions in that the main program doesn't need to know which library packages need to be wrapped up. Charlie -- Nobody in this country got rich on his own. You built a factory--good. But you moved your goods on roads we all paid for. You hired workers we all paid to educate. So keep a big hunk of the money from your factory. But take a hunk and pay it forward. Elizabeth Warren (paraphrased)