🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Memory Mapped files

#384
From: Totte Karlsson
Date: Fri, 18 Apr 2008 23:46
27 lines
1768 bytes
Sorry, I found the problem!
Where I remap the view
if(!mmFile.MapViewOfFile(FILE_MAP_WRITE, 0, bytesWrittenInView, bytesToMap)
I position the view wrongly. Instead of bytesWrittenInView, it should be 
totalBytes written. Sorry for that..

Can confirm that Memory mapped files are much faster than regular file I/O..


-tk

Totte Karlsson wrote:
>            
>         //move the view forward...
>         if(!mmFile.MapViewOfFile(FILE_MAP_WRITE, 0, 
> bytesWrittenInView,               bytesToMap))
>         {
>             cout<<"Failed changing the view\n";
>             break;
>         }
>         else
>         {
>             cout<<"Changed view..\n";
>         }
>            
>         bytesWrittenInView = 0;
>     }
Technical Details
Message-ID: <4809330e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!2001:4de0:1::4.MISMATCH!ramfeed1.eweka.nl!eweka.nl!hq-usenetpeers.eweka.nl!213.239.142.3.MISMATCH!feed.xsnews.nl!border-2.ams.xsnews.nl!news.isoc.lu!newsgroups.borland.com!not-for-mail
References: <48093003$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,79f316e1c3e3acf8
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 18 Apr 2008 16:46:40 -0700
From: Totte Karlsson <tottek@gmail.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Memory Mapped files
References: <48093003$1@newsgroups.borland.com>
In-Reply-To: <48093003$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 75.165.79.45
Message-ID: <4809330e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1208562446 75.165.79.45 (18 Apr 2008 16:47:26 -0700)
Lines: 27
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!2001:4de0:1::4.MISMATCH!ramfeed1.eweka.nl!eweka.nl!hq-usenetpeers.eweka.nl!213.239.142.3.MISMATCH!feed.xsnews.nl!border-2.ams.xsnews.nl!news.isoc.lu!newsgroups.borland.com!not-for-mail