View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001956 | 1003.1(2024)/Issue8 | System Interfaces | public | 2025-11-10 19:47 | 2025-11-10 19:47 |
| Reporter | dhruv | Assigned To | |||
| Priority | low | Severity | Editorial | Type | Enhancement Request |
| Status | New | Resolution | Open | ||
| Name | Dhruv McElwaine | ||||
| Organization | |||||
| User Reference | |||||
| Section | https://pubs.opengroup.org/onlinepubs/9699919799/ | ||||
| Page Number | n/a | ||||
| Line Number | All of them | ||||
| Interp Status | |||||
| Final Accepted Text | |||||
| Summary | 0001956: Standardise event queue based asynchronous io. | ||||
| Description | Many 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 Action | POSIX 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). | ||||
| Tags | No tags attached. | ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2025-11-10 19:47 | dhruv | New Issue |