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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e81fd3a32a1cacd2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.hanau.net!noris.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Does Ada tasking profit from multi-core cpus? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1170071840.010200.85210@s48g2000cws.googlegroups.com> <1173089302.125025.31370@t69g2000cwt.googlegroups.com> <0dmdnZIAd76ZpXPYnZ2dnUVZ_uCinZ2d@comcast.com> <1lq9zxgrnvfjx$.17ip3w3ei4xdb.dlg@40tude.net> Date: Thu, 8 Mar 2007 11:15:04 +0100 Message-ID: NNTP-Posting-Date: 08 Mar 2007 11:15:05 CET NNTP-Posting-Host: dcb75f97.newsspool1.arcor-online.net X-Trace: DXC=NJo:`R]@hoF2:OR3:3gaE@ic==]BZ:afN4Fo<]lROoRAFl8W>\BH3YBjB;^`NDi2fADNcfSJ;bb[EFCTGGVUmh?DLK[5LiR>kgB[7Xe030NhLD X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:14423 Date: 2007-03-08T11:15:05+01:00 List-Id: On Wed, 7 Mar 2007 23:21:04 -0600, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:1lq9zxgrnvfjx$.17ip3w3ei4xdb.dlg@40tude.net... > ... >> Just a side note, the Windows API GetThreadTimes (which the viewer >> apparently uses) is corrupted. It counts complete time quants rather than >> the performance counter ticks. So, potentially you could observe 1% under >> factual 99% CPU load. The bug should appear for threads performing much >> synchronization, because they leave the processor before the current quant >> expiration. > > I wouldn't call it "corrupted"; it's just not very accurate (given that it > can only register time with a granularity of 0.01 sec). If it were just inaccurate then the obtained values would be like ThreadTime + Error where Error has zero mean. That is just not the case. ThreadTime has a systematic error => in my view corrupt. It simply does not measure what its name assumes. > I don't think there > is any other way to find out CPU use, though, as the performance counter > provides wall time and thus isn't very useful to find out how much a thread > is running. (I've tried to figure out how to implement Ada.Execution_Time on > Windows...) Yes, at the user level there seems to be no way to do it. The performance counter should be queried at the scheduling points, and the increment of should be accumulated for the thread possessing the processor. Only the OS kernel could do that. Ada.Execution_Time looks quite a problem for Windows... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de