comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Eachus <rieachus@comcast.net>
Subject: Re: Real tasking problems with Ada.
Date: Mon, 21 Aug 2017 22:10:50 -0700 (PDT)
Date: 2017-08-21T22:10:50-07:00	[thread overview]
Message-ID: <1c96818b-cdd4-4e9e-a9f1-dd9bcaab557c@googlegroups.com> (raw)
In-Reply-To: <om2vkc$dlv$1@franka.jacob-sparre.dk>

On Friday, August 4, 2017 at 7:22:54 PM UTC-4, Randy Brukardt wrote:
> "Robert Eachus" writes:
> 
> >Now I'm really confused. ...
> 
> You've reached the limits of my knowledge of memory hardware. In theory, the 
> Independent_Components aspect should ensure that different components can be 
> read/written by different tasks independently. But I don't know how/whether 
> cache lines get involved (my understanding was that putting the components 
> into different words was sufficient). But you could be right (having tried 
> this much more than I have). In any case, the compiler is supposed to do the 
> right thing when Independent_Components is used.
> 
The problem is that Independent_Components will insure that the compiler can generate relatively simple code to access components even if they are accessed by different tasks.  However, simple code doesn't take into account caches.  In other words, if occasional collisions where two tasks access the same cache line at about the same time occur, you will get the expected (right) results, at a slight cost in CPU time.  But if you have two tasks accessing the same cache line on a regular basis, your code will be dog slow.  I could write up a test program if you want--store data in records and have the processing of any record require at least two tasks.  Then a version where the data is stored in arrays accessed by key (AKA) index.

  reply	other threads:[~2017-08-22  5:10 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
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 [this message]
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