comp.lang.ada
 help / color / mirror / Atom feed
From: Hadrien Grasland <hadrien.grasland@gmail.com>
Subject: Re: RFC: Prototype for a user threading library in Ada
Date: Sat, 18 Jun 2016 00:56:02 -0700 (PDT)
Date: 2016-06-18T00:56:02-07:00	[thread overview]
Message-ID: <a3c0ac3c-88cd-4dac-9c30-e7d11d355acc@googlegroups.com> (raw)
In-Reply-To: <dsim6eF91ubU1@mid.individual.net>

Le vendredi 17 juin 2016 18:18:25 UTC+2, Niklas Holsti a écrit :
> I had a quick first look, and it seems interesting, but I have two 
> suggestions to make the development more understandable to the 
> Ada-oriented reader:
> 
> - First, please do not redefine the word "task", even in the qualified 
> form "asynchronous task". It is quite confusing, in the Ada context.
> 
> - Second, I question the terminology of "user thread". The "events", or 
> "asynchronous tasks", are not "threads" in the sense of keeping their 
> own machine-level control-flow state; they are automata that are invoked 
> from the "executors" through a single "Run" operation. If some 
> control-flow state must be kept between invocations of "Run", the 
> "asynchronous task" must keep it in Ada-level variables/components.
> 
> I don't quite know what to call your "events" / "asynchronous tasks", 
> but perhaps the term "work item", which you use in a comment, is better.

Terminology has indeed been much of a pain for me, and something I can improve before freezing the interface. The main issue that I have is to find a good usability compromise between reusing familiar names when possible, and avoiding name clashes with existing concepts that have different meanings.

I thought I could be fine by focusing on terms that are known to have highly overloaded meanings across the software landscape, and thus warn the user that special attention to definitions is required, but you are right that in the Ada context "task" is definitely problematic enough to warrant trying to find something else.

What's nice about "task", in a C++ context at least, is that the Intel marketing department did quite a good job of imposing that as the official terminology for the elementary work unit of user-mode cooperative multitasking facilities. They were followed in this by other "task-parallel" libraries like HPX, so these days, when someone familiar with one of these libraries sees a "task", they get an idea which is quite close to what I mean here.

Common alternatives such as "green threads" or "user thread" are clearly inferior, in the sense of being politically loaded in the first case and only comprehensible by people with an OS tech background in the second case. "coroutine" or "process" is abusing established terminology that means something very different, and "generator" is only really usable for functional abstractions that yield results, as it is a very clumsy term to describe procedural abstractions that simply return control to the caller.

As for "work-item", it is something which I played with recently, but I'm not very keen on it either because in the OpenCL context, it has a totally different meaning, and I thus fear that users experienced with the OpenCL terminology would interprete a "work-item" as something that is somewhat lightweight, and fall in the trap of too fine a task granularity. Still, it looks better than the options above, so I may converge on it unless a better idea emerges.

Again, the great thing about "task" is that it is highly descriptive and was not widely used in the C++ community before, but obviously that is not true in an Ada context.

---

On the other hand, I am quite keen on "event" because what I am proposing is a near-superset of the OpenCL event model, although the use of a higher-level programming language allows for a much more convenient programming interface. An alternative which I had in mind was "completion", but although it brings some disambiguation with the interrupt-like event model used by e.g. GUI toolkits, it is also highly nonstandard, and somewhat confusing in the sense that "manipulating a completion" is meaningless.

  parent reply	other threads:[~2016-06-18  7:56 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17  9:44 RFC: Prototype for a user threading library in Ada Hadrien Grasland
2016-06-17 16:18 ` Niklas Holsti
2016-06-17 16:46   ` Dmitry A. Kazakov
2016-06-18  8:16     ` Hadrien Grasland
2016-06-18  8:47       ` Dmitry A. Kazakov
2016-06-18  9:17         ` Hadrien Grasland
2016-06-18 11:53           ` Dmitry A. Kazakov
2016-06-20  8:23             ` Hadrien Grasland
2016-06-20  9:22               ` Dmitry A. Kazakov
2016-06-23  1:42       ` Randy Brukardt
2016-06-23  8:39         ` Dmitry A. Kazakov
2016-06-23 22:12           ` Randy Brukardt
2016-06-24  7:34             ` Dmitry A. Kazakov
2016-06-24 23:00               ` Randy Brukardt
2016-06-25  7:11                 ` Dmitry A. Kazakov
2016-06-26  2:02                   ` rieachus
2016-06-26  6:26                     ` Dmitry A. Kazakov
2016-06-24  0:38           ` rieachus
2016-06-25  6:28             ` Dmitry A. Kazakov
2016-06-26  1:34               ` rieachus
2016-06-26  3:21               ` Randy Brukardt
2016-06-26  6:15                 ` Dmitry A. Kazakov
2016-06-28 20:44                   ` Anh Vo
2016-07-02  4:13                   ` Randy Brukardt
2016-07-02 10:25                     ` Dmitry A. Kazakov
2016-07-05 21:53                       ` Randy Brukardt
2016-07-06  9:25                         ` Dmitry A. Kazakov
2016-07-07  0:32                           ` Randy Brukardt
2016-07-07  6:08                             ` Niklas Holsti
2016-07-08  0:03                               ` Randy Brukardt
2016-07-08  7:32                                 ` Dmitry A. Kazakov
2016-07-11 19:40                                   ` Randy Brukardt
2016-07-12  8:37                                     ` Dmitry A. Kazakov
2016-07-12 21:31                                       ` Randy Brukardt
2016-07-08 20:17                                 ` Niklas Holsti
2016-06-24 21:06         ` Hadrien Grasland
2016-06-26  3:09           ` Randy Brukardt
2016-06-26  6:41             ` Dmitry A. Kazakov
2016-07-02  4:21               ` Randy Brukardt
2016-07-02 10:33                 ` Dmitry A. Kazakov
2016-07-05 21:24                   ` Randy Brukardt
2016-07-06 13:46                     ` Dmitry A. Kazakov
2016-07-07  1:00                       ` Randy Brukardt
2016-07-07 14:23                         ` Dmitry A. Kazakov
2016-07-07 23:43                           ` Randy Brukardt
2016-07-08  8:23                             ` Dmitry A. Kazakov
2016-07-11 19:44                               ` Randy Brukardt
2016-06-26  9:09             ` Hadrien Grasland
2016-07-02  4:36               ` Randy Brukardt
2016-07-02  5:30                 ` Simon Wright
2016-07-05 21:29                   ` Randy Brukardt
2016-07-02 11:13                 ` Hadrien Grasland
2016-07-02 13:18                   ` Dmitry A. Kazakov
2016-07-02 16:49                     ` Hadrien Grasland
2016-07-02 21:33                       ` Niklas Holsti
2016-07-03 20:56                         ` Hadrien Grasland
2016-07-02 17:26                   ` Niklas Holsti
2016-07-02 21:14                   ` Niklas Holsti
2016-07-03  7:42                     ` Hadrien Grasland
2016-07-03  8:39                       ` Dmitry A. Kazakov
2016-07-03 21:15                         ` Hadrien Grasland
2016-07-04  7:44                           ` Dmitry A. Kazakov
2016-07-05 21:38                   ` Randy Brukardt
2016-06-21  2:40     ` rieachus
2016-06-21  7:34       ` Dmitry A. Kazakov
2016-06-18  7:56   ` Hadrien Grasland [this message]
2016-06-18  8:33 ` Hadrien Grasland
2016-06-18 11:38 ` Hadrien Grasland
2016-06-18 13:17   ` Niklas Holsti
2016-06-18 16:27   ` Jeffrey R. Carter
2016-06-20  8:42 ` Hadrien Grasland
2016-07-10  0:45 ` rieachus
replies disabled

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