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.176.92.11 with SMTP id q11mr1978953uaf.14.1501120853530; Wed, 26 Jul 2017 19:00:53 -0700 (PDT) X-Received: by 10.36.82.207 with SMTP id d198mr104232itb.8.1501120853475; Wed, 26 Jul 2017 19:00:53 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!w51no216650qtc.0!news-out.google.com!f71ni424itc.0!nntp.google.com!t6no94574itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 26 Jul 2017 19:00:52 -0700 (PDT) In-Reply-To: <49d02dda-8f1b-4005-a164-7af34e1993cc@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8303:2100:e4d2:d8c1:3b2b:a73f; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8303:2100:e4d2:d8c1:3b2b:a73f References: <9e51f87c-3b54-4d09-b9ca-e3c6a6e8940a@googlegroups.com> <49d02dda-8f1b-4005-a164-7af34e1993cc@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Real tasking problems with Ada. From: Robert Eachus Injection-Date: Thu, 27 Jul 2017 02:00:53 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 3603 X-Received-Body-CRC: 42113822 Xref: news.eternal-september.org comp.lang.ada:47520 Date: 2017-07-26T19:00:52-07:00 List-Id: On Wednesday, July 26, 2017 at 3:42:57 PM UTC-4, sbelm...@gmail.com wrote: > On Tuesday, July 25, 2017 at 7:19:59 PM UTC-4, Robert Eachus wrote: > > 1) Add a function Current_CPU or whatever (to System.Multiprocessors= ) that returns the identity of the CPU this task is running on. =20 > >=20 > > 2) Allow a task to its CPU assignment after it has started executio= n.=20 > >=20 >=20 > Are these not exactly what System.Multiprocessors.Dispatching_Domains.Get= _CPU and Set_CPU do? Short answer, not exactly. Yes, if I had posted the code I'm working on--p= robably sometime next week--you would have seen me using just that. But th= e operations from Dispatching_Domains are pretty heavyweight--even if you i= gnore bringing in the extra packages. What I would like are very lightweig= ht operations. Bringing in Ada.Real_Time and Ada.Task_Identification for d= efault parameters which are never used would be bad enough, the problem is = the program ends up checking the values passed. So a call to Set_CPU(ID); = is really a call to: Set_CPU(ID, Ada.Task_Identification.Current_Task), whi= ch can't be done before a task has an ID assigned. If on a particular implementation, they are exactly the same, then all I am= asking for is some declarative sugar which requires four lines of source a= dded to Ada.Multitasking. But what I really want is the ability to start a= task on the processor core it will stay on. Ah, you say, I can set the as= pect CPU. Well, not really. I can't determine how many CPU cores are available until run-time. That me= ans if I want to generate tasks on a per CPU core basis, I can/must create = them at run-time. But there is no way for me to set the CPU aspect when I = have an array of (identical) tasks. I can set the aspect for tasks named T= om, Dick, and Harry like in the examples, but if I declare: Worker_Tasks: a= rray(1..Number_of_CPUs), I can't set the CPU other than by an entry, which = serializes the tasks when there are lots of them. Remember, some of those = tasks, on some hardware, will need to run on a chip in a socket over there = somewhere. It's just making things harder for non-real-time programmers for no reason.= And when you see the results from the work I am doing, you will be either= astonished or appalled.