View Issue Details

IDProjectCategoryView StatusLast Update
00019561003.1(2024)/Issue8System Interfacespublic2025-11-10 19:47
Reporterdhruv Assigned To 
PrioritylowSeverityEditorialTypeEnhancement Request
Status NewResolutionOpen 
NameDhruv McElwaine
Organization
User Reference
Sectionhttps://pubs.opengroup.org/onlinepubs/9699919799/
Page Numbern/a
Line NumberAll of them
Interp Status
Final Accepted Text
Summary0001956: Standardise event queue based asynchronous io.
DescriptionMany different POSIX platforms support asynchronous disc IO. However, the existing POSIX APIs to access this underlying feature are woefully inadequate, with the result being that almost no software uses it. In addition, the mechanism chosen for completion notification is incompatible with the asyncio mechanism used on some platforms (Linux and Windows). Many platforms now support a newer style of asynchronous io, with the following primitives:

* Creating an 'event queue'.

* Dequeuing one or more event packets from the queue, blocking as necessary.

* Associating a file description with the event queue, such that when the file description becomes readable/ writable/ any other condition detectable by `poll`, a packet is posted.

* Starting an asynchronous file operation, with a packet being queued on completion or error.

For example:

* Linux has `io_uring_setup`, `io_uring_enter`, `IORING_OP_POLL_ADD`, and `IORING_OP_READV`/`IORING_OP_WRITEV`.

* BSD had `kqueue`, `kevent`, `EVFILT_READ`/`EVFILT_WRITE`/etc., and a combination of `EVFILT_AIO` and sigevent.

* QNX has `ChannelCreate`, `MsgReceivev`, `ionotify`, and a combination of `SIGEV_PULSE` and sievent.

 Cygwin/Windows NT has some combination of `CreateIoCompletionPort`/ `GetQueuedCompletionStatusEx`/ `ProcessSocketNotifications`/ `NTWaitCompletionPacket`/ `ReadFile`/ `WriteFile`/ ect.(The NT kernel has many strengths, but orthoganality isn't one of them).

* MacOS refuses to implement anything more recent than 2008, and so has no async file IO.

Desired ActionPOSIX should standardise an API along the lines above, to allow for async file IO in a reasonable and portable manner.

Open questions:

* Should we mandate thread safety? For it is that the only API listed above that isn't thread safe is Linux's io_uring, which can be shimmed over in a low-cost manor. Against it that it would make it harder to implement on new platforms.

* Should we reuse the existing aio infrastructure? For it that is would reduce API bloat, and BSD and QNX implement it this way already. Against it that it would make it much* harder to implement on platforms that don't support it in the kernel(i.e. Linux's io_uring, Windows, future platforms).
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2025-11-10 19:47 dhruv New Issue