🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Getting Started with Memory Mapped Files

#124
From: dhoke
Date: Wed, 11 Jun 2008 17:28
41 lines
2856 bytes
Another (? - don't know what you have) example that I've found to be a 
simple reference:
http://www.codeproject.com/KB/threads/csharedstruct.aspx

However, comments in the code specifically indicate that author had trouble 
trying to figure out how to use security ACLs to obtain results of the 
nature you desire (with some processes having only read-access and other(s) 
having more)...

But maybe it will clarify what area you need to look at.

(Also note that the class as presented there does not set its member 
variable m_bCreated, which might be useful in some cases.)

As to whether the mutex is necessary, that would depend on you - if you need 
to write multiple things that have to be "consistent" with one another, then 
a mutex probably would be necessary.  If any modified item is exclusively 
valid, than no mutex should be required (given that you want only one 
process to write to the area.)

"Mike Collins" <its@TheBottomOfThePost> wrote in message 
news:48500053@newsgroups.borland.com...
>
> Having read a bit about this, it seems that a Memory Mapped file would be 
> the easiest option.  So I'm just experimenting with Mem Mapped Files and 
> there's a few things that I don't quite understand.  I need my service to 
> be able to read and write to the MMF but I don't want any other process to 
> be able to modify it...
>

>
> 5) I'm looking at a code example in VC++ and the author seems to have used 
> a mutex to control access whilst reading or writing - is this necessary?
>
> Sorry about the length of questions, and pointers or suggestions would be 
> gratefully received.
>
> Many thanks,
>
> Mike
> 
Technical Details
Message-ID: <48500b4c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-out.readnews.com!news-xxxfer.readnews.com!207.99.111.53.MISMATCH!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <48500053@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,b80765c4c39946b4
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "dhoke" <dhoke.nojunk@east-shore.com>
From: "dhoke" <dhoke.nojunk@east-shore.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <48500053@newsgroups.borland.com>
Subject: Re: Getting Started with Memory Mapped Files
Date: Wed, 11 Jun 2008 13:28:38 -0400
Lines: 43
Organization: East Shore Technologies, Inc.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 70.109.101.57
Message-ID: <48500b4c$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1213205324 70.109.101.57 (11 Jun 2008 10:28:44 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-out.readnews.com!news-xxxfer.readnews.com!207.99.111.53.MISMATCH!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail