Re: Cache
- From: "Doron Holan [MS]" <doronh@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 25 Aug 2005 20:00:05 -0700
the driver itself doesn't do any caching. the i/o manager or the FS might
though.
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"George" <georgeyu@xxxxxxxxxxxxxxxx> wrote in message
news:%237etR%23UqFHA.364@xxxxxxxxxxxxxxxxxxxxxxx
> Hi Doron,
>
> Thanks for the quick response. I have another question that may or may not
> have anything to do with the cache. For the USB mass storage device (i.e.
> USB flash drive), it seems to me that the Windows driver will do (write??)
> something in device's FAT area including MBR. This may cause problem when
> your application is doing the low level stuff, i.e. formatting the device
> or
> writing to the flash sector by sector. When your application exits, the
> Windows mass storage device driver might still write things to the device.
> This could cause your intended operation to fail. Is there a way to
> prevent
> Windows device driver from interfering when your application is perform
> low
> level IOs with the device?
> Another question (maybe the same as above) is under Windows 2000 system
> whether it's safe to remove the USB mass storage device after completing
> the
> low level operations without doing a safe removal?
>
> Thanks very much for the help.
>
> Best regards,
> George
>
> "Doron Holan [MS]" <doronh@xxxxxxxxxxxxxxxxxxxx> ¦b¶l¥ó
> news:%23ZjYVGUqFHA.3520@xxxxxxxxxxxxxxxxxxxx ¤¤¼¶¼g...
>> when you open the file handle, you can specify no caching. from
>>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/createfile.asp
>>
>> FILE_FLAG_NO_BUFFERING
>>
>> The system opens a file with no system caching. This flag does not
>> affect hard disk caching. When combined with FILE_FLAG_OVERLAPPED, the
> flag
>> gives maximum asynchronous performance, because the I/O does not rely on
> the
>> synchronous operations of the memory manager. However, some I/O
>> operations
>> take more time, because data is not being held in the cache. Also, the
> file
>> metadata may still be cached. To flush the metadata to disk, use the
>> FlushFileBuffers function.
>> An application must meet certain requirements when working with
> files
>> that are opened with FILE_FLAG_NO_BUFFERING:
>>
>>
>> a.. File access must begin at byte offsets within a file that are
>> integer multiples of the volume sector size.
>> b.. File access must be for numbers of bytes that are integer
>> multiples of the volume sector size. For example, if the sector size is
> 512
>> bytes, an application can request reads and writes of 512, 1024, or 2048
>> bytes, but not of 335, 981, or 7171 bytes.
>> c.. Buffer addresses for read and write operations should be
> sector
>> aligned, which means aligned on addresses in memory that are integer
>> multiples of the volume sector size. Depending on the disk, this
> requirement
>> may not be enforced.
>> One way to align buffers on integer multiples of the volume sector
>> size is to use VirtualAlloc to allocate the buffers. It allocates memory
>> that is aligned on addresses that are integer multiples of the operating
>> system's memory page size. Because both memory page and volume sector
> sizes
>> are powers of 2, this memory is also aligned on addresses that are
>> integer
>> multiples of a volume sector size.
>>
>> An application can determine a volume sector size by calling the
>> GetDiskFreeSpace function
>>
>>
>>
>> --
>> Please do not send e-mail directly to this alias. this alias is for
>> newsgroup purposes only.
>> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>>
>>
>> "George" <georgeyu@xxxxxxxxxxxxxxxx> wrote in message
>> news:uTRyEDSqFHA.3520@xxxxxxxxxxxxxxxxxxxxxxx
>> > Hi,
>> >
>> > I am not sure if this is an appropriate group for this question, so
> please
>> > feel free to direct me elsewhere. I'd like to knwo how to adjust the
>> > system
>> > cache to zero under Windows 2000. The purpose is to ensure Windows is
>> > synchronized with a USB mass storage device during a lengthy write
>> > operation, whatever retrieved from the Windows' file system is directly
>> > written to the USB mass storage device without been stored in the cache
>> > first.
>> > Thanks for the help.
>> >
>> > George
>> >
>> >
>>
>>
>
>
.
- Prev by Date: load USB mouse filter driver
- Next by Date: Re: Safe DataTypes
- Previous by thread: Re: Cache
- Next by thread: supporting multiple usb devices
- Index(es):
Relevant Pages
|