🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7567

Re: Accessing same variable from multiple threads

#7567
From: Bob Gonder
Date: Thu, 20 Jan 2005 04:16
30 lines
2591 bytes
Alan Bellingham wrote:

>Bob Gonder  wrote:
>
>>I disagree. The alignment should be inconsequential.
>>If CPU A is doing a mov  (one cpu instruction) on 2 dwords (due to
>>misalignment), then those 2 dwords should be locked by the memory
>>handler (as it does an internal read/modify/write), so that CPU B
>>can't access them.
>
>Even if the two parts are in two different pages, and the second causes
>a page fault? Or will the memory handler lock cause the page fault and
>subsequent frantic activity as the page gets loaded?

Page faults are not a memory problem.
The physical memory does not know about them. (pretty sure)
The cpu, when it is decoding addresses will detect a page fault and
bring in the needed page before ever sending the data to memory.
But I see the point now, that the two dwords might not actually be
contiguous in physical ram if they span a page boundry.

If anyone knows which of the many manuals this is covered in, and
preferably, the chapter and verse, I'd be interested.

>Yes, for those. (And some may well consider an __int64 as a primitive.)

On some machines, it is.

Some day all machines will be omnibit, using whatever sized integers
that make sense for the current function.
Technical Details
Message-ID: <k3buu0l9c4herd94u2ilm7l9sc175gmjc1@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41edea6b@newsgroups.borland.com> <41ee3727$1@newsgroups.borland.com> <41ee742e$1@newsgroups.borland.com> <41ee8f57$1@newsgroups.borland.com> <qu9tu0hgv4gqnlvv65nqq70ua4v73jv0mu@4ax.com> <ktatu01v81kub73v28uhkhp1ccrl4ct9j6@4ax.com> <qmmtu09mtj1dnckicq85cq03k9ro6aqsje@4ax.com> <ddotu0t652i1q3a5ulnnt0c78ocr25vuae@4ax.com> <5a0uu015uqqt50bu5knqa704tkhkmuebia@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4809cdd9a7828fa7
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Accessing same variable from multiple threads
Date: Wed, 19 Jan 2005 20:16:44 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <k3buu0l9c4herd94u2ilm7l9sc175gmjc1@4ax.com>
References: <41edea6b@newsgroups.borland.com> <41ee3727$1@newsgroups.borland.com> <41ee742e$1@newsgroups.borland.com> <41ee8f57$1@newsgroups.borland.com> <qu9tu0hgv4gqnlvv65nqq70ua4v73jv0mu@4ax.com> <ktatu01v81kub73v28uhkhp1ccrl4ct9j6@4ax.com> <qmmtu09mtj1dnckicq85cq03k9ro6aqsje@4ax.com> <ddotu0t652i1q3a5ulnnt0c78ocr25vuae@4ax.com> <5a0uu015uqqt50bu5knqa704tkhkmuebia@4ax.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.69.91.123
X-Trace: newsgroups.borland.com 1106194601 69.69.91.123 (19 Jan 2005 20:16:41 -0800)
Lines: 33
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail