🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.memory
Article #11

NT: Using Mem. Map. Files to Share Dynamic Memory?

#11
From: Blake Streeter
Date: Fri, 03 Nov 1995 18:42
43 lines
2153 bytes
Dynamic Shared Memory in DLL using MMF:

  Hello,

    I'm having a problem figuring something out.

    I'm designing a system Using Visual C++ 2.0 for 32 bit 
Windows NT.

    I want to create and share a DYNAMIC List of messages in 
a DLL.  Multiple tasks will have to add-to and remove-from this 
list.  I've read several articles on the Microsoft Developers 
Network CD discussing Shared memory in DLL's.  This also led me 
to Memory Mapping files (MMF).  I've read, and I think I understand, 
how to use MMF for sharing memory.

But there is still one thing I don't understand :

   Once I have created, or opened this Named MMF in each task 
that attaches to the DLL how do I get my DLL Add-To-List Function 
to allocate a block of memory within my MMF just big enough for a 
Message List Entry? (Which happens to be a structure) So that once 
I assign the data to the memory every task can see and access it?
How do I get my Remove-From-List function to deallocate this small
block of memory so that it can be used again?

  Do I have to do the Memory Management within the MMF myself?
Doesn't memory access fall only on page boundries?  (i.e. 4096 bytes)  

  What If I want to have multiple instances of my list each 
containing different messages within the DLL?  Would I have to 
create a MMF for each list?

  Thanks in advance for any and all help you can give me.  
Please Respond Via Email Because I don't read all the groups
I'm posting to.

 Thank you,

   Blake Streeter
   bstreete@ic1d.harris.com 

Harris corporation.
Technical Details
Message-ID: <47dnqk$5hd@jabba.ess.harris.com>
Path: arc1-ca.pugleaf.net!jabba.ess.harris.com!usenet

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!jabba.ess.harris.com!usenet
From: Blake Streeter <bstreete@ic1d.harris.com>
Newsgroups: comp.os.ms-windows.programmer.memory,comp.lang.c++,comp.os.ms-windows.programmer.misc,comp.os.ms-windows.nt.misc
Subject: NT: Using Mem. Map. Files to Share Dynamic Memory?
Date: 3 Nov 1995 18:42:28 GMT
Organization: Harris Corporation
Message-ID: <47dnqk$5hd@jabba.ess.harris.com>
NNTP-Posting-Host: jgarnett3.ess.harris.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.2N (Windows; I; 32bit)