On Tuesday, July 16, 2002, 5:42:28 PM, you (mailto:[EMAIL PROTECTED]) wrote: > On Mon, Jul 15, 2002 at 08:59:40PM -0400, Melvin Smith wrote: >> And the aioread/aiowrite/listio, etc. are a POSIX standard now, so they >> should be reasonably available on most UNIXen.
> Are the aio* calls available on Windows? No, but since it would seem helpful, here is the quick version of asynchronous IO on windows. NB. Windows NT/2000/XP supports async io on HDDs as well as sockets, pipes, ...; Win 9x/ME doesn't do it for HDDs. Basically there are three methods of performing asynchronous io on Windows, and these are essentially the same whatever you are reading from/writing to (including accepting connections on sockets). 1. Callback function. 2. Signal an event 3. IO Completion The first two are linked to individual IO operations (ReadFile(Ex), WriteFile(Ex)) if the handle was opened with the appropriate flag. In the first case the function is passed to the IO call, in the second an "OVERLAPPED" structure is passed containing the handle of an event. When using an event you can then wait for the event to be signalled (in much the same way that other kernel objects are signalled). Additionally there is a method for polling for completion. The third way involves associating the file (or whatever) handle with an IOCompletion port, you then have one or more threads sitting in a blocking call to PostQueuedCompletionStatus which returns as the various IO operations complete). The whole area shares a lot with the thread APIs and generally is not too hard to use once you get the hang of the style... however quite how compatible with the POSIX/Mac/... style I have no idea. (For more information see http://msdn.microsoft.com and follow the link to the library, File IO comes under Windows Base Services.) -- Richard mailto:[EMAIL PROTECTED]