flat assembler
Message board for the users of flat assembler.

Index > Windows > Open file, read by char and count a specyfic char

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 23 Jan 2014, 09:44
Windows internally uses memory mapping extensively, so it rarely reads less than page at once (hence default cluster size for NTFS is 4 KiB since NT 4). Reading entire file for sequential access is an overkill, too many pages will be committed — gaining nothing. You may hint CreateFile with FILE_FLAG_SEQUENTIAL_SCAN flag; heh, caching may be disabled entirely using FILE_FLAG_NO_BUFFERING, though restrictions apply.

Anyway, guesswork is futile: there is "Windows Internals" book by Mark, David and Alex, containing most, if not all, nitty-gritty details about I/O system, memory and cache managers. A 'must read' for a serious Windows programmer, I should say.

P.S. AsmGuru62, you're probably right, that overhead of sanity checks may be quite big.
Post 23 Jan 2014, 09:44
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.