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.98.131.134 with SMTP id h128mr4174213pfe.27.1503378650883; Mon, 21 Aug 2017 22:10:50 -0700 (PDT) X-Received: by 10.36.110.20 with SMTP id w20mr159993itc.7.1503378650726; Mon, 21 Aug 2017 22:10:50 -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!border1.nntp.ams1.giganews.com!border2.nntp.ams1.giganews.com!nntp.giganews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!x187no236248ite.0!news-out.google.com!c139ni2327itb.0!nntp.google.com!x187no236184ite.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 21 Aug 2017 22:10:50 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8303:2100:4dbf:79ac:dfdd:9f98; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8303:2100:4dbf:79ac:dfdd:9f98 References: <9e51f87c-3b54-4d09-b9ca-e3c6a6e8940a@googlegroups.com> <49d02dda-8f1b-4005-a164-7af34e1993cc@googlegroups.com> <914ae4df-cc52-4e6e-b342-584bcac98e88@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1c96818b-cdd4-4e9e-a9f1-dd9bcaab557c@googlegroups.com> Subject: Re: Real tasking problems with Ada. From: Robert Eachus Injection-Date: Tue, 22 Aug 2017 05:10:50 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 3015 X-Received-Body-CRC: 1924472479 Xref: news.eternal-september.org comp.lang.ada:47780 Date: 2017-08-21T22:10:50-07:00 List-Id: On Friday, August 4, 2017 at 7:22:54 PM UTC-4, Randy Brukardt wrote: > "Robert Eachus" writes: >=20 > >Now I'm really confused. ... >=20 > You've reached the limits of my knowledge of memory hardware. In theory, = the=20 > Independent_Components aspect should ensure that different components can= be=20 > read/written by different tasks independently. But I don't know how/wheth= er=20 > cache lines get involved (my understanding was that putting the component= s=20 > into different words was sufficient). But you could be right (having trie= d=20 > this much more than I have). In any case, the compiler is supposed to do = the=20 > right thing when Independent_Components is used. >=20 The problem is that Independent_Components will insure that the compiler ca= n generate relatively simple code to access components even if they are acc= essed by different tasks. However, simple code doesn't take into account c= aches. 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 (r= ight) results, at a slight cost in CPU time. But if you have two tasks acc= essing 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 hav= e 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.