title: aio on osx: Is it implemented in the kernel or with user threads? Other Options?
body: <p>I am working on my small c++ framework and have a file class which should also support async reading and writing. The only solution other than using synchronous file i/o inside some worker threads I found is aio. Anyways I was looking around and read somewhere, that in Linux, aio is not even implemented in the kernel but rather with user threads. Is the same true for OSX? Another concern is aio's functionality of callbacks which has to spawn an extra thread for each callback since you can't assign a certain thread or threadpool to take care of that (signals are not an option for me). So here are the questions resulting from that:</p>
  
  <ul>
  <li><p>Is aio implemented in the Kernel of osx and thus is most likely better than my own threaded implementation?</p></li>
  <li><p>Can the callback system -spawning a thread for each callback- become a bottleneck in practice?</p></li>
  <li><p>If aio is not worth using on osx, are there any other alternatives on unix? in cocoa? in carbon?</p></li>
  <li><p>Or should I simply emulate async i/o with my own threadpool?</p></li>
  </ul>
  
  <p>What is your experience on the subject?</p>