logo       

Re: handling disk IO within asio programs: msg#00002

lib.boost.asio.user

Subject: Re: handling disk IO within asio programs

Hi Jose,

Jose <jmalv04-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote:
> Can you provide a code snippet on how to handle disk IO within
> asio (using threads) given that asio does not support asynch
> disk IO ?

The "services" example included with asio does half of what you
want -- it uses a background thread to perform logging
operations asynchronously to the main thread. The missing
element in that example is posting the completion handler back
to the application.

You might also look at the implementation of the
resolver_service in asio/detail/resolver_service.hpp, since that
uses a background thread to emulate asynchronous hostname
resolution.

Cheers,
Chris



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise