473,474 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Memory Mapped IO and Sample code for win2000

Hi All,
I have some software that currently loads database tables into sorted arrays
in memory to be binary searched by processes. (Long story as to why it does
this..)

Each process must either read the data from the in memory array or from the
database itself if the table is too large to be loaded into memory. (2GB is
usually the limit because the array is indexed by a 32 bit signed integer.
I have never had one of these tables go over 2GB, even when the client had
20M customers.)

This current set up is fine for companies with a few million customers and a
few million transactions per day. The software works just fine on win2000
and solaris/aix. None of my existing customers has large enough lookup
tables or so many transactions that it is a problem to load them into
memory.

However, one of the major 'upgrades' I want to make to this code is to
enable it to share these in-memory arrays between many processes. This
sharing of memory will make the product pretty much 'endlessly scalable',
and this is where I want to get it to.

The idea is that if the customer is a large telephone company then I can
split the Call Detail Records into say 12 input files and have 12 processes
run at the same time. By sharing the tables to be searched in memory I can
cut the memory requirement by a factor of 12. By putting all the data to be
looked up into memory the speed of processing the CDRs can be maximised
because a lookup to a database is at least 20 times slower than the lookup
to the array even if the data is in memory.

I have the code I need to do this under solaris.....but from the examples I
can see in VS.NET it looks like windows 2000 acts a little differently.

Questions....

Q1. Does anyone have a fragement of code for a producer/consumer for memory
mapped IO under win2000 that they are willing to share? Or is there a good
public example anywhere that someone here can point to? The examples I can
find with vs.net are in java or very old.

Q2. Is there a 2GB limit on creating a memory mapped file under win2000?

Q3. Will a memory mapped file like this run at the same speed as an in
memory array that is created by calloc like the current one? (Once the
producer has loaded the table into memory all other processes are
'read-only' and will be able to read the memory at the same time, no locks
required.)

Q4. Are there any other pointers the experts on this group might like to
pass along to someone going to do their very first Memory Mapped IO piece of
work? Are there any 'gotchas' for beginners in this area?

All assistance is much appreciated!!!

Best Regards

Peter Nolan
www.peternolan.com
Jul 22 '05 #1
1 2402
Peter Nolan wrote:
Hi All,
I have some software that currently loads database tables into sorted
arrays in memory to be binary searched by processes. (Long story as to why
it does this..) ... deleted All assistance is much appreciated!!!

Best Regards

Peter Nolan
www.peternolan.com


Hi, the ACE framework (http://www.cs.wustl.edu/~schmidt/ACE.html) provides
memory mapped files on all it's supported platforms (man unices, embedded
systems and win32)

Lothar
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bryan Parkoff | last post by:
I work emulator project using 32 Bit emulated processor. The problem is that it attempts to allocate 4GB memory because some people want to use emulated instruction to read data from 4GB memory. ...
16
by: Justin Lazanowski | last post by:
Cross posting this question on the recommendation of an I have a .NET application that I am developing in C# I am loading information in from a dataset, and then pushing the dataset to a grid,...
19
by: Holger Hasselbach | last post by:
- The value of the object allocated by the malloc function is used (7.20.3.3). - The value of any bytes in a new object allocated by the realloc function beyond the size of the old object are used...
2
by: vikas | last post by:
I have following structure in c++. typedef struct MMF_result_struct { int action; char text; int cols,rows; int month,day,year; } MMF_result; Now this structure is shared between C++ and C#...
5
by: Nirosh | last post by:
Hi All, Can any one suggest me a best way to do this .. I have a thrid party tool "EXE" that we need to use with our web service to manipulate some complex XML files, which reside in a...
0
by: Tomas | last post by:
I have two questions: (1) How (if possible) can you, with ASP.NET (and with the IIS 5 included with win2000) specify an maximum limit of the memory that a web application may consume, as an...
9
by: Maxwell2006 | last post by:
Hi, Is there a concept of shared named memory in .NET to allow multiple program use the name and then set/retrieve values? Thank you, Alan
13
by: Samshayam | last post by:
I have come across the application of placement new in memory mapped i/o in a number of books.I am not able to understand it completely, may be becaues of my lack of knowledge with memory mapped...
41
by: simonl | last post by:
Hi, I've been given the job of sorting out a crash in our product for which we have the crash information and an avi of the event (which can't possibly match but more of that later...) (btw this...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.