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=ham 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: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 07 Mar 2007 03:31:20 -0600 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Does Ada tasking profit from multi-core cpus? References: X-Newsreader: Tom's custom newsreader Message-ID: <7YKdnQIyBcT1G3PYnZ2dnUVZ_sSmnZ2d@comcast.com> Date: Wed, 07 Mar 2007 03:31:20 -0600 NNTP-Posting-Host: 67.164.83.70 X-Trace: sv3-05rpEVPTEDYrn7hv1qp/gj/1wu1FGWXn7zSBkE3lFRkeQoe8CVKmVNsC+UYTpI1bAMY3GGbEuoDCZFI!wggO4ysDoUU2FEyOx8p2Yir0Q0/aBoANG/MapirL3tP9EKtRMJgn7GSqjGqtH75urXo1ZVqFj0Gi!ou2SEsC+JwEDUg== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.34 Xref: g2news2.google.com comp.lang.ada:9742 Date: 2007-03-07T03:31:20-06:00 List-Id: >>> 3. Can a task switch cores? If yes, what is the overhead of switching? > >AFAIK, Windows indeed switches thread's processors, >so GNAT 3.15p should follow it as well (provided, tasks are mapped on >threads and no thread affinity mask is set). Interesting would be to know >the penalty of such switching. 5 microseconds? I ran a loop storing away successive values of Ada.Calendar.Clock while another task was sitting burning cpu cycles. The delta-t's between successive clock readings were almost all under 1 microsecond, but there was a cluster around 5-6 mics and another at 250-300 mics, the latter occurring pretty regularly every 2.9 milliseconds. So I would hazard a guess that the 5-6 mic hiccups were due to a simple core switch. It might be 250-300 mics, with the round-robin time slice being 2.9 ms, but spending 10% of a CPU on running the time slicer seems excessive, so I'm guessing that's doing something substantive - polling hardware or running the myriad background tasks in a Windows system. OTTH, it's too late to think rationally anyway.