logo       

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

lib.boost.asio.user

Subject: Re: handling disk IO within asio programs


Hi Jose,

Jose <jmalv04-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote:
> Is the following reasoning correct ?
> For file IO (compared to the services example) it is best to
> create a new thread for every completed write otherwise I
> don't see how a single background thread can scale (or keep a
> thread pool)

Hmm, I think one thread per write is too much. How about a
thread pool calling io_service::run() on the "hidden"
io_service, and use a strand per file object to make sure that
the writes don't get out of order or corrupt each other.

> I think asio should have some file_service for this very
> common need What do you think ?

Yes, it's one thing I would like to add at some point, when i get
time :) I'd like integrate the work done by Felipe Magno de
Almeida to provide native asynchronous file I/O if it's
available on a particular platform.

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