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 Path: g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool3.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="iso-8859-1" Content-Transfer-Encoding: 8bit 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> Date: Wed, 7 Mar 2007 09:39:43 +0100 Message-ID: <1lq9zxgrnvfjx$.17ip3w3ei4xdb.dlg@40tude.net> NNTP-Posting-Date: 07 Mar 2007 09:39:43 CET NNTP-Posting-Host: 89611fa1.newsspool3.arcor-online.net X-Trace: DXC=3>3eeno4UMnj5k5aEF7ISmMcF=Q^Z^V3h4Fo<]lROoRaFl8W>\BH3Yb1GbNE\e:ZVdDNcfSJ;bb[eFCTGGVUmh?dLK[5LiR>kgb[aDQ@4S8Ygj X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:9740 Date: 2007-03-07T09:39:43+01:00 List-Id: On Tue, 6 Mar 2007 19:58:31 -0800, Steve wrote: > "Dmitry A. Kazakov" wrote in message > news:rgcukvs1j6ck$.1vjj69zzy1h56$.dlg@40tude.net... >> On 5 Mar 2007 02:08:22 -0800, Ludovic Brenta wrote: >> >>> "� jpluto" wrote: >>>> Has someone experience with Ada tasking (especially GNAT) on multi-core >>>> systems? >>>> >>>> Show programs with several working tasks a performance boost on >>>> dual-core or >>>> quad-core cpus? >>> >>> On my dual-core Turion 64 with Debian GNU/Linux and GCC 4.1.2, all is >>> well. Ada programs using tasking use both cores. I think it would work >>> on most other platforms too, but YMMV. >> >> Apart from using both cores, does anybody know how protected objects >> function on multi-cores? Especially: >> >> 1. Whether protected object's functions are indeed executed concurrently >> when come from the tasks running on different cores? >> >> 2. What are the times required to take/release the protected object's spin >> lock compared to ones on single core? >> >> 3. Can a task switch cores? If yes, what is the overhead of switching? > > On Windows, which uses symmetric multiprocessing, I belive two cores works > the same as two CPU's. With two CPU's the two highest priority threads that > are in the ready state run concurrently, so yes a task can switch cores. > Sorry I don't know about the overhead of switching. > I have run tests on a system with 2 CPU's and found that a single task that > does a lot of switching winds up using 50% of the CPU time on both CPU's > (from the task viewer). 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. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de