Good afternoon. We are prototyping the Windows / LINUX dedupor using a memory-compatible API file for Windows and Linux. Our deduper is started by sequentially scanning all database records that must be deduplicated. Therefore, we pass the FILE_FLAG_SEQUENTIAL_SCAN flag to the Windows CreateFile API during our sequential sequential scan of the database records that must be deduplicated. As soon as we finish the first part of the deduplication process, we will try to use the Windows memory mapping API for random access to data. At this point, using the Windows C ++ API, is it possible to dynamically change the FILE_FLAG_RANDOM_ACCESS mode?
In Linux, we are are able to do this with the following excerpt of code,
MapPtr = (char*)mmap((void *)BaseMapPtr ,mappedlength,PROT_READ,
MAP_PRIVATE, hFile,baseoff );
if (MapPtr == MAP_FAILED){
perror("mmap");
throw cException(ERR_MEMORYMAPPING,TempFileName);
}
madvise(MapPtr,mappedlength,MADV_RANDOM);
Windows, FILE_FLAG_SEQUENTIAL_SCAN . .