views:

296

answers:

2

The boost::asio package contains 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?

+2  A: 

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

Andrew McGregor
Asio works under Mac OS X yes, however asynchronous file io is not available. According to the docs: Boost.Asio includes classes added to permit synchronous and asynchronous read and write operations to be performed on POSIX file descriptors, such as pipes, standard input and output, and various devices (but not regular files). ( http://www.boost.org/doc/libs/1_41_0/doc/html/boost_asio/overview/posix/stream_descriptor.html ).
villintehaspam
Updated the question to make it more clear that its only the file io part of the asio package that is "missing" for other platforms than Windows.
villintehaspam
Sorry, I missed that too. I think the better approach would be to treat OS X as a POSIX system, that way you get generic Unixen and Linux as well. See the `aio_read(2)` system call and `man aio`. And then maybe submit the class to Boost, because this really should be there.
Andrew McGregor
A: 

Hey, did you eventually figgure out how to use it on osx or made progress porting it yourself?

thanks!

moka
Sofar I haven't attempted to do this, since getting MacOS X support for the software I'm working on no longer is of highest importance. I will post an update if this should change however.
villintehaspam
Comments like this should be posted as comments, not as answers...
bdonlan