🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3489

Re: SysV shared memory coherency issues

#3489
From: Ryan Underwood
Date: Tue, 14 Feb 2006 20:35
19 lines
3166 bytes
=?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=  <spamtrap@crayne.org> writes:

>> 	if (((uint32_t*)m_Mailbox)[STALE_MBOX*2] != 1)
>> 		{ /* these actions are taken when mbox value is set to 0 */ }

>Why all this casting ?

The memory region is a double *.  The cast is so that the compiler would
generate an integer load instead of a FP load.

>It'd be interresting to see what differences there were if you made
>the flag a simple int, with the volatile keyword too.

I imagine it would work since the above cast works.  My question is why loading
it as a double does not work.

>(But really - you should be protecting this using semaphores)

Why?  I don't see a mutual exclusion problem.
Technical Details
Message-ID: <qMqdnbVjI-xgo2_eRVn-jA@fidnet.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!sn-xt-sjc-04!sn-xt-sjc-06!sn-post-01!supernews.com!corp.supernews.com!news.crayne.org!clax86!robomod!not-for-mail
References: <-Z-dneLPKKkNlWzeRVn-oQ@fidnet.com> <43f189d7$1@news.broadpark.no>

Show Full Headers
Complete Article Headers
X-Google-Thread: fc89c,83404d35faeda18b
X-Google-Thread: f5392,83404d35faeda18b
X-Google-Thread: 11318c,83404d35faeda18b
X-Google-Thread: 114917,83404d35faeda18b
X-Google-Attributes: gidfc89c,gidf5392,gid11318c,gid114917,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!sn-xt-sjc-04!sn-xt-sjc-06!sn-post-01!supernews.com!corp.supernews.com!news.crayne.org!clax86!robomod!not-for-mail
From: Ryan Underwood  <spamtrap@crayne.org>
Newsgroups: comp.unix.programmer,comp.os.linux.development.system,gnu.gcc.help,comp.lang.asm.x86
Subject: Re: SysV shared memory coherency issues
Approved: CLAX86 Moderators <ccrayne@crayne.org>
Date: Tue, 14 Feb 2006 14:35:09 -0600
Organization: Crayne Consulting
Message-ID: <qMqdnbVjI-xgo2_eRVn-jA@fidnet.com>
Sender: clax86@wotan.crayne.org
References: <-Z-dneLPKKkNlWzeRVn-oQ@fidnet.com> <43f189d7$1@news.broadpark.no>
X-CLAX86-Policy: http://www.pacificsites.com/~ccrayne/clax86.html
X-CLAX86-Faq: http://www.faqs.org/faqs/by-newsgroup/comp/comp.lang.asm.x86.html
X-CLAX86-Info-1: Send submissions to comp-lang-asm-x86@moderators.isc.org
X-CLAX86-Info-2: Send technical complaints to clax86-admin@crayne.org
X-CLAX86-Info-3: Send complaints about policy to clax86-admin@crayne.org
X-Comment: moderators do not necessarily agree or disagree with this article.
X-Authentication-Warning: serv2.gc.dca.giganews.com: news set sender to poster@giganews.com using -f
User-Agent: nn/6.7.2
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.32
X-Greylisting: NO DELAY (Relay+Sender autoqualified);
 processed by UCSD_GL-v2.1 on mailbox8.ucsd.edu;
 Tue, 14 February 2006 12:35:12 -0800 (PST)
X-Spam-Level: Level 
X-Spamscanner: mailbox8.ucsd.edu  (v1.6 Aug  4 2005 15:27:38, 0.0/5.0 3.0.4)
X-MailScanner: PASSED (v1.2.8 22435 k1EKZAGm049026 mailbox8.ucsd.edu)
X-PacificInternet-MailScanner-Information: Please contact the ISP for more information
X-PacificInternet-MailScanner: Found to be clean
X-PacificInternet-MailScanner-SpamCheck: not spam (whitelisted),
 SpamAssassin (score=-0.001, required 5.5, autolearn=disabled,
 SPF_HELO_PASS -0.00)
X-PacificInternet-MailScanner-From: poster@giganews.com
X-Spam-Status: No
X-UIDL: X<P!!M$I"!A12!!ZI1"!
X-Complaints-To: abuse@supernews.com
Lines: 20