comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Termination of periodic tasks
Date: Wed, 18 Jun 2014 09:32:23 +0200
Date: 2014-06-18T09:32:23+02:00	[thread overview]
Message-ID: <pntzseldtily$.fttzsymuguck.dlg@40tude.net> (raw)
In-Reply-To: 1lndy96.or7wdo1tdxu58N%csampson@inetworld.net

On Tue, 17 Jun 2014 13:14:23 -0700, Charles H. Sampson wrote:

> Natasha Kerensikova <lithiumcat@instinctive.eu> wrote:
> 
>> Hello,
>> 
>> On 2014-06-15, J-P. Rosen <rosen@adalog.fr> 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.

That is true. I am writing a lot of code with tasking and was unaware of
the issue with library level tasks.

>      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.

I prefer a stateless design of packages with explicit objects maintaining
the state, created by the client. That eliminates the problem of task
termination too.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2014-06-18  7:32 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-15 10:10 Termination of periodic tasks Natasha Kerensikova
2014-06-15 12:11 ` Dmitry A. Kazakov
2014-06-15 15:23 ` J-P. Rosen
2014-06-16 13:54   ` Natasha Kerensikova
2014-06-17 20:14     ` Charles H. Sampson
2014-06-18  7:32       ` Dmitry A. Kazakov [this message]
2014-06-15 16:54 ` Jeffrey Carter
2014-06-16 14:02   ` Natasha Kerensikova
2014-06-16 15:08     ` Dmitry A. Kazakov
2014-06-16 17:08     ` Jeffrey Carter
2014-06-17  6:57       ` Natasha Kerensikova
2014-06-17  7:37         ` Dmitry A. Kazakov
2014-06-17  7:47           ` Natasha Kerensikova
2014-06-17  8:45             ` Dmitry A. Kazakov
2014-06-17  9:00               ` Natasha Kerensikova
2014-06-17 12:55                 ` Dmitry A. Kazakov
2014-06-17 14:51                   ` J-P. Rosen
2014-06-17 16:44                     ` Dmitry A. Kazakov
2014-06-17 20:00                       ` Randy Brukardt
2014-06-17 20:16                         ` Jeffrey Carter
2014-06-17 21:30                         ` Simon Wright
2014-06-17 12:02         ` Jacob Sparre Andersen
2014-06-17 19:32           ` Natasha Kerensikova
2014-06-17 17:53         ` Jeffrey Carter
2014-06-17 20:03           ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox