Search This Blog

Thursday, December 01, 2005

Little Change to Asynchronous I/O

I've decided to make a slight change to how LibQ handles one of the three methods of completion notification. Instead of using a CEvent to notify the application of I/O completion, the new method internalizes the waiting process. Practically, instead of waiting on a CEvent you specify when the you begin the I/O, you'll now wait on the CAsyncStatus for the I/O, itself (this requires that the operation be marked as waitable, when initiated).

There are a couple reasons for this. First, it should be a little faster on POSIX systems, due to more direct OS support. Second, it will allow timed waits on I/O completion (remember that timed waits could not be implemented with the CEvent on POSIX, due to technical difficulties).

A third benefit, although I don't know if I'm going to even do this, yet, would be that it allows the possibility of waiting for multiple waitable I/O operations at once, returning when one of them completes (or the timeout expires). However, due to incomplete OS support, this might be slower than desired.

No comments: