You don't really "configure" the file object to
behave one way or another - usually that is determined by
the type of file object itself and a lot of other
conditions.
The Advise method is there so that the file object can
communicate
its behavior to whoever is using it.
For instance, a local filesystem can (*most* of the time)
respond synchronously, while the http filesystem may
usually
respond asynchronously. If the user of the file object
wants
to do some optimization based on whether the file object
is going to respond synchronously/asynchronously, then
the Advise method is where it gets that information.
Eric
=============================================
Eric Hyche (ehyche real.com)
Technical Lead
RealNetworks, Inc.
> -----Original Message-----
> From: filesystem-dev-bounces helixcommunity.org
> [mailto:filesystem-dev-bounces helixcommunity.org] On
Behalf
> Of S Plissken
> Sent: Tuesday, April 03, 2007 10:51 PM
> To: filesystem-dev helixcommunity.org
> Subject: [Filesystem-dev] SYNCACCESS vs ASYNCACCESS
>
> Hi,
>
> I have been looking at some datatype source code, and I
> notice the following code:
> I would like to know what is the difference between
> SYNCACCESS vs ASYNCACCESS
> And how can I configure to have SYNCACCESS instead of
> ASYNCACCES or vice versa?
>
>
> // Find out if syncrhonous use of input is possible
> if (SUCCEEDED(retVal))
> {
> if
(SUCCEEDED(m_pFileSwitcher->Advise(HX_FILEADVISE_SYNCACCE
SS)))
> {
> m_bSyncAccessEnabled = TRUE;
>
m_pFileSwitcher->Advise(HX_FILEADVISE_ASYNCACCESS);
> }
>
> HX_RESULT adviseRes =
>
m_pFileSwitcher->Advise(HX_FILEADVISE_RANDOMACCESS);
>
> if (HXR_ADVISE_PREFER_LINEAR == adviseRes)
> {
> m_bPreferLinearAccess = TRUE;
> }
> }
>
>
>
>
>
_______________________________________________
Filesystem-dev mailing list
Filesystem-dev helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/
filesystem-dev
|