Article View: borland.public.cppbuilder.nativeapi
Article #165Re: when to call MapViewOfFile()
From: Bob Gonder
Date: Sun, 29 Jun 2008 23:44
Date: Sun, 29 Jun 2008 23:44
23 lines
1696 bytes
1696 bytes
Mike Collins wrote: >My question is, do you have to call MapViewOfFile() each time you read the >MMF or can it be called once, initially. For example, should it be called >from within the WaitForSingleObject() call? Seems to work either way, just >want to know what is the best practice. I'd say run a timed test both ways. My gut says keeping the map and mutex around is faster than creating them for every read. My philosophy is "thrashing" is a Bad Thing. Doubly so with Windows Resources. Only potential drawback to keeping them open would be if the server-writes are slower because the OS has to update all those open maps. I don't think that's an actual problem however. You could also run a server timed test with the server constantly writting to see if there is any writting difference between clients with/without open maps.
Technical Details
Message-ID:
<eb6g641bfr1olgbgf3lqrjd0avnclmj9bo@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mailReferences:
<486800e2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9e6b8470002d53ed X-Google-Attributes: gid10cc67,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <none@nowhere.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: when to call MapViewOfFile() Date: Sun, 29 Jun 2008 16:44:01 -0700 Message-ID: <eb6g641bfr1olgbgf3lqrjd0avnclmj9bo@4ax.com> References: <486800e2$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.77.147.203 X-Trace: newsgroups.borland.com 1214783039 67.77.147.203 (29 Jun 2008 16:43:59 -0700) Lines: 25 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mail