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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Real tasking problems with Ada. Date: Wed, 2 Aug 2017 22:43:44 -0500 Organization: JSA Research & Innovation Message-ID: References: <9e51f87c-3b54-4d09-b9ca-e3c6a6e8940a@googlegroups.com> <49d02dda-8f1b-4005-a164-7af34e1993cc@googlegroups.com> <914ae4df-cc52-4e6e-b342-584bcac98e88@googlegroups.com> Injection-Date: Thu, 3 Aug 2017 03:43:45 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="26015"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: news.eternal-september.org comp.lang.ada:47563 Date: 2017-08-02T22:43:44-05:00 List-Id: "Robert Eachus" wrote in message news:914ae4df-cc52-4e6e-b342-584bcac98e88@googlegroups.com... On Tuesday, August 1, 2017 at 12:45:43 AM UTC-4, Randy Brukardt wrote: >> Yes, really. Use a discriminant of type CPU, and use that in the aspect. >> That's an age-old technique, and indeed is the major reason that tasks >> have >> discriminants. You then can allocate the tasks (which would be my >> suggestion), or you could create the entire set in an aggregate (assuming >> you have Ada 2020). >Sorry, you missed what all the shouting was about. ;-) On the processor I >am using >(an AMD FX-6300 Vishera) running on all CPU cores causes contention for the >floating-point units. So for efficiency I have to run on one core from >each pair of >CPU cores. Currently my program uses 2,4, and 6. Creating an array >indexed by >CPU doesn't work. Who said anything about indexing an array by CPUs? If you're able to allocate tasks, then create them with whatever CPUs you want and index the array by whatever you want, there's no reason that they have to be tied together. Any if you can't, you're probably in a Ravenscar or similar environment, and those do not allow any sort of dynamic assignment of CPUs. So you're not allowed to do what you want in any case. ... >Yes, I knew what I was doing was messy and dangerous--or at least required >careful checking. My point was that if Maximum_Alignment was large enough, >I wouldn't be going through the pain. The maximum alignment an implementation supports comes directly from the linker in use. Since most Ada implementations use system linkers that are completely out of their control, it's not really possible to support anything larger. (One can do it dynamically with a significant waste of memory, but that is not the sort of solution that is wanted on an embedded system.) Randy.