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: border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!fx03.iad.POSTED!not-for-mail From: Brad Moore User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: can someone help me with this code (explanation) References: <6e1f86e6-c17a-428e-bb19-460c5ba26c8a@googlegroups.com> <1ec7272d-de7f-43dd-be30-009c437011de@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Message-ID: NNTP-Posting-Host: 68.145.219.148 X-Complaints-To: internet.abuse@sjrb.ca X-Trace: 1412050936 68.145.219.148 (Tue, 30 Sep 2014 04:22:16 UTC) NNTP-Posting-Date: Tue, 30 Sep 2014 04:22:16 UTC Date: Mon, 29 Sep 2014 22:22:17 -0600 X-Received-Bytes: 4699 X-Received-Body-CRC: 1158347570 X-Original-Bytes: 4617 Xref: number.nntp.dca.giganews.com comp.lang.ada:189247 Date: 2014-09-29T22:22:17-06:00 List-Id: On 14-09-26 10:08 AM, G.B. wrote: > On 26.09.14 17:31, Björn Lundin wrote: >> On 2014-09-26 16:49, J-P. Rosen wrote: >>> Le 26/09/2014 16:15, Björn Lundin a écrit : >>>> http://www.sigada.org/conf/sa98/papers/mueller.pdf >>>> >>>> I did not read all of it, but the conclusion is that >>>> context switches are bad for performance. >>>> If a protected object can REPLACE a task, it >>>> will show in measurements. (and they did measure) >>> >>> That's a paper from 16 years ago. Computers as well as compilers have >>> evolved a lot, therefore I would not trust the paper for making a >>> decision nowadays... >>> >> >> Yes, I did point that out. >> But still, I have no problem believing >> that context switches still is bad for performance. > > Task switches, or tasks in the first place, are, > apparently, heavy weight. That's by comparing two Ada programs, > > http://benchmarksgame.alioth.debian.org/u64q/program.php?test=threadring&lang=gnat&id=2 > > > to > > http://benchmarksgame.alioth.debian.org/u64q/program.php?test=threadring&lang=gnat&id=4 > Apparently the heaviness of tasks is dependent on usage. I just submitted another version that was accepted today, which moves Ada up the ladder a bit. http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=threadring In fact, only the Go and the Haskell entries are consistently ahead of this latest version for all 4 processor configurations. The Ada version has 503 tasks executing with calls on a protected entry (where each task maps to an OS thread in GNAT). Looking at the Go example, I'm guessing that the 503 lightweight threads are being executed by a single OS thread, likely under a work-stealing scheduler, where the work never gets stolen by other cores, since this benchmark mostly involves a sequential handoff of a token to the next thread. It that's whats happening, then it might explain why the Go version is still quite a bit faster, since executing the problem on the same core doesn't require as much overhead and locking to do the handoff. > > and then both of them to the "different kind" of parallelism > exhibited by the leading entries. The leading entries are faster by > an orders of magnitude, even though the faster Ada program uses > just semaphores. > > It might be better for Ada if at least the parallel loop initiatives > announced in Ada Letters are getting somewhere. I'm just guessing at > the effectiveness WRT async little things, though. > The proposals are gathering steam. We are moved the design of our proposal along quite a bit since the earlier papers, and even quite a bit since our most recent paper. In fact, our latest paper is being presented at HILT 2014 in Portland next month. The syntax has been revamped and simplified, while providing better information to the compiler so that the compiler may verify if the parallelism can occur while also allowing the compiler to do more implicit parallelism. Now seems a good opportunity to plug the conference.... :-) Come to HILT everyone! (High Integrity Language Technologies) October 18-21, 2014 — Portland, Oregon (USA). http://sigada.org/conf/hilt2014/ This year HILT is colocated with the SPLASH conference (Systems, Programming, Languages, and Applications: Software for Humanity) http://2014.splashcon.org/ Brad