comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Real tasking problems with Ada.
Date: Wed, 2 Aug 2017 22:43:44 -0500
Date: 2017-08-02T22:43:44-05:00	[thread overview]
Message-ID: <olu65h$pcv$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: 914ae4df-cc52-4e6e-b342-584bcac98e88@googlegroups.com

"Robert Eachus" <rieachus@comcast.net> 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.


  reply	other threads:[~2017-08-03  3:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 23:19 Real tasking problems with Ada Robert Eachus
2017-07-26 19:42 ` sbelmont700
2017-07-27  2:00   ` Robert Eachus
2017-08-01  4:45     ` Randy Brukardt
2017-08-02  2:23       ` Robert Eachus
2017-08-03  3:43         ` Randy Brukardt [this message]
2017-08-03 20:03           ` Robert Eachus
2017-08-03 23:10             ` Luke A. Guest
2017-08-04 23:22             ` Randy Brukardt
2017-08-22  5:10               ` Robert Eachus
2017-08-01  4:41 ` Randy Brukardt
2017-08-02  3:44   ` Robert Eachus
2017-08-02 14:39     ` Lucretia
2017-08-03  0:57       ` Robert Eachus
2017-08-03  5:43         ` Randy Brukardt
2017-08-03  1:33       ` Wesley Pan
2017-08-03  4:30       ` Randy Brukardt
2017-08-03  4:16     ` Randy Brukardt
2017-08-03  5:05       ` Niklas Holsti
2017-08-04 23:11         ` Randy Brukardt
2017-08-05  7:01           ` Niklas Holsti
2017-08-03  8:03     ` Simon Wright
2017-08-04 23:16       ` 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