Re: Cache



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
> >
> >
>
>


.



Relevant Pages

  • Re: Safely Remove Hardware
    ... Expand disk drives by right clicking on the + then click on the drive of ... USB Mass Storage Device, ... Try the Windows XP General newsgroup, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Cache
    ... Please do not send e-mail directly to this alias. ... > writing to the flash sector by sector. ... > Windows mass storage device driver might still write things to the device. ...
    (microsoft.public.development.device.drivers)
  • Re: Safely Remove Hardware
    ... Windows Internet Explorer, ... Expand disk drives by right clicking on the + then click on the drive of ... USB Mass Storage Device, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: IPOD WONT BE DETECTED BY WINDOWS!!!!!!!!!!!!!!!
    ... recently my ipod just stopped being detected by windows and itunes. ... read it as a usb mass storage device and shows up in device mananger under ...
    (microsoft.public.windowsxp.general)
  • Re: Safely Remove Hardware
    ... window, titled, 'Safely Remove Hardware' opens. ... USB Mass Storage Device, ... Try the Windows XP General newsgroup, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)

Loading