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!news1.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 12:47:31 -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: Date: Wed, 07 Mar 2007 12:47:31 -0600 NNTP-Posting-Host: 67.164.83.70 X-Trace: sv3-Yz09sjcIsJCk2wJeIz9ee4KpkHEpQEKHNFJ/sPOxcymzkGZse+Bux3C451nKpsLMCtq9LnIoQ43mdC1!/AbwX/HGPgelIFRfc5eRWR0egA3V5LxBhjWWn7ErD9qO6LDFeC629jG5/tfkrVlbwU0J1nN5jhKr!rKE7cDIIcX5C4pqWz4ex53cTVmGr 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:9756 Date: 2007-03-07T12:47:31-06:00 List-Id: > > Sorry. That's a typo in trying to pretty-up the code for posting. > > The actual code that ran was: > > if pt_flag /= id then > > result := result+1; > > pt_flag := id; > > end if; > Was the return statement > return change_count; > or some other item whose value was never changed according to the The code that I ran was correct. It never had any variable named change_count. In the pretty-ed version I posted I left out the "+1" in one place while changing the variable name "result" to "change_count". That's also why > > If I change it from a single > > protected object to two instances of a protected type, then the function > > calls are overlapped and return non-zero results. which of course would not have been the case if the running code hadn't included the "+1". I'd be curious to know if newer versions of Gnat run protected functions concurrently. My version of Gnat 3.15p-nt is dated late 2002, at which time there were not many multi-cpu Windows systems around to take advantage of such a feature.