Kernel 2.6 is finally here, and it touts several enhancements over the 2.4 series. The press has highlighted changes relevant to systems architects and managers, but there’s plenty in 2.6 for application developers, too.
Kernel 2.6 is finally here, and it touts several enhancements over the 2.4 series. The press has highlighted changes relevant to systems architects and managers, but there’s plenty in 2.6 for application developers, too.
This month’s column provides an overview of some updates and new features in 2.6, including filesystem support, threading library changes, and the new kernel-level profiler. This article assumes you already have access to a machine running 2.6. For features that must be explicitly enabled, the kernel config option (such as CONFIG_PROFILING) is listed.
Asynchronous I/O
Asynchronous I/O (AIO) separates I/O operations from the calling function. Similar to running a shell command in the background, an application constructed with AIO can issue a series of long-running requests and immediately continue its other processing. Later on, the application can go back and check the results of those operations. AIO-enabled programs appear more responsive because the I/O operations occur independently of the application’s main event loop.
While it’s possible to realize asynchronous I/O with threads, the AIO calls do the work for you: you needn’t design your own framework to accept I/O requests and publish the results.
Once you’ve installed a recent build of the libaio library, you’re ready to AIO-enable your apps.
1. First, create a context using io_setup().
2. Associate a series of I/O calls with the context using io _submit().
3. Later, call io_getevents() to retrieve the status and results of context operations, or call io_cancel() to cancel…
Please log in to view this content.
Not Yet a Member?
Register with LinuxMagazine.com and get free access to the entire archive, including: