From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2007-06-08 09:36:38
On Mon, 4 Jun 2007 03:12:08 +0700,
> OK, I got it. By "async requests" I mean requests running concurrently,
> and I don't have to wait others to process available data. Am I right?
> Does asio use POSIX AIO in Linux implementation? I mean librt functions.
No, it uses epoll and non-blocking I/O to emulate asynchronous
> How to make some other work while doing i/o operations in single threaded
Here are two different approaches you could take:
- If your program has given over control to io_service::run(), use a
chain of posts() or maybe a deadline_timer to perform the work in small
// perform a small amount of work here
// post this function again to do a bit more work.
- If you want the main program control to be your "other work",
periodically call io_service::poll() to check for completed I/O
operations and invoke the associated handlers.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk