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.66.159.2 with SMTP id wy2mr1078235pab.10.1418898764708; Thu, 18 Dec 2014 02:32:44 -0800 (PST) X-Received: by 10.140.109.162 with SMTP id l31mr5664qgf.22.1418898764658; Thu, 18 Dec 2014 02:32:44 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!h15no24866740igd.0!news-out.google.com!r1ni69qat.1!nntp.google.com!s7no8807984qap.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 18 Dec 2014 02:32:44 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=185.30.132.97; posting-account=hya6vwoAAADTA0O27Aq3u6Su3lQKpSMz NNTP-Posting-Host: 185.30.132.97 References: <455d0987-734a-4505-bb39-37bfd1a2cc6b@googlegroups.com> <8277a521-7317-4839-b0b6-97f8155be1a4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9e1d2b9f-1b97-4679-8eec-5ba75f3c357c@googlegroups.com> Subject: =?ISO-8859-1?Q?Re=3A_GNAT=A0and_Tasklets?= From: vincent.diemunsch@gmail.com Injection-Date: Thu, 18 Dec 2014 10:32:44 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:24108 Date: 2014-12-18T02:32:44-08:00 List-Id: > >>=20 > > What is a "physical task" and a "logical task" ? > > For me : > > - a task is a "logical task", because it is a concept of the Ada langag= e. > > - a thread is what you call a "physical task", because it is an OS feat= ure. >=20 > RM mingles task and thread: >=20 > "The execution of an Ada program consists of the execution of one or more > tasks. Each task represents a separate thread of control that proceeds > independently and concurrently between the points where it interacts with > other tasks." RM 9(1) >=20 > Your "thread" is an implementation of a task. >=20 I agree that a thread is an implementation of the logical concept of a task= , and that is how I understand the above sentence of the RM that you quote. But, = there are different threads : - a kernel thread is created and scheduled by the kernel, with great power = and also great cost (kernel memory and high overhead for context switch). B= ut it allows the use of different CPU (multicore) and the use of concurrent= processes even by time slicing. Basically this is an abstraction of a CPU. =20 - a user-level thread is created and scheduled inside the process by the ru= ntime, it is much faster and lighter, but is less powerful : typically time= slicing is not supported and threads need to cooperate more. User-level th= reads are often multiplexed on one or more kernel threads. - finaly jobs, executed on a pool of workers (kernel threads) provide very = lightweight threads. All are threads, each class of them corresponding to a level of complexity = of an Ada task : Library level, permanent tasks are typically kernel thread= s, Library level dynamic tasks created on demand are typically user-level t= hreads, and little local task, needed for a parallel computation are often = simple jobs. And if the compiler chose only one implementation, like always a kernel thr= ead for a task, which is the case now, I have to say that it is not a matur= e implementation of tasking. Finaly, I really hope that the new version of the langage will keep Ada sim= ple and add "intelligence" in compilers and not add different new features = with : - tasks for kernel threads - coroutines or tasklets for user-level threads - jobs for lightweight threads, because this would be a major conceptual regression. I believe that aspects= on tasks could be an inelegant but decent way to solve the problem. Regards, Vincent