Aio on osx: is it implemented in the kernel or with user threads? Other options?

I am working on my little C ++ structure and have a file class that should also support reading and writing async. The only solution besides using synchronous file I / O inside some workflows that I found is aio. In any case, I looked around and read somewhere that on Linux, ayo is not even implemented in the kernel, but rather with user threads. Is the same true for OSX? Another problem is the functionality of the callback functions, which should generate an additional thread for each callback, since you cannot assign a specific thread or threadpool to take care of this (the signals are not for me). So, here are the questions arising from this:

  • Is aio implemented in the osx kernel, and therefore is probably better than my own thread implementation?

  • Can a callback system - cut off the thread for each callback - become a bottleneck in practice?

  • If aio is not worth using in osx, are there any other unix alternatives? in cocoa? in carbon?

  • Or should I just emulate async i / o with my own threadpool?

What is your experience in this matter?

+3
source share
2 answers

You can see exactly how AIO is implemented on OSX correctly here .

, , , ( , , ).

sysctl. , sysctl -a | grep aio

kern.aiomax = 90
kern.aioprocmax = 16
kern.aiothreads = 4

, AIO, .

, , Mac OS X . (. ).

, , , . , , darwin, - (. fcntl F_LOG2PHYS), .

+4

@Moka: , linux, 2.6 AIO, libaio (libaio.h)

, Kernel, , POSIX.1 AIO, , , UNIX .

0

All Articles