List Info

Thread: SYNCACCESS vs ASYNCACCESS




SYNCACCESS vs ASYNCACCESS
user name
2007-04-03 21:50:49
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_SYNCACCESS)))
    {
   ;     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;
    }
   ; }



RE: SYNCACCESS vs ASYNCACCESS
country flaguser name
United States
2007-04-04 08:04:02
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 (ehychereal.com)
Technical Lead
RealNetworks, Inc.  

> -----Original Message-----
> From: filesystem-dev-bounceshelixcommunity.org 
> [mailto:filesystem-dev-bounceshelixcommunity.org] On
Behalf 
> Of S Plissken
> Sent: Tuesday, April 03, 2007 10:51 PM
> To: filesystem-devhelixcommunity.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-devhelixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/
filesystem-dev

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )