The boost::asio package contai开发者_StackOverflowns classes for doing asynchronous file io in Windows using IO completion ports. To my understanding, there is no support for asynchronous file io for other platforms included in the asio package.
I am wondering what would need to be done in order to extend asio with asynchronous file io support for at least Mac OS X, but also to some extent Linux. I am mostly interested in what would need to be done on the asio side of things, but since I am not that experienced with Mac OS X programming I don't mind pointers on where to find more information on how to do asynchronous file io in Mac OS X as well - is PBReadForkAsync what I should be looking at?
Update: I've finally gotten around to attempt to build asynchronous file io (outside boost::asio) on Mac OS X using aio_read/aio_write, however I am unable to get the callback data I need (see How to get user data for aio signal handler in Mac OS X).
According to this page, boost::asio works on OS X, with one minor constraint: http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio/overview/implementation.html
精彩评论