Skip to content

Add reactor-backed proactor implementation #196

Description

@mrabine

Description

Introduce a Proactor class that emulates asynchronous I/O on top of the existing epoll Reactor. Each submitted IoOperation registers the proactor as an EventHandler on the operation's fd; when epoll signals readiness the proactor executes the syscall and signals completion. The implementation is intentionally forward-compatible with a future io_uring backend (JOIN_HAS_IO_URING): IoOperation opcodes, lifecycle states, and the cancel API are designed to map directly onto io_uring semantics when that backend is introduced.
A ProactorThread convenience class mirrors ReactorThread and owns a Proactor running on a dedicated background thread.

Acceptance Criteria

  • IoOperation struct is introduced with opcodes Read, Write, ReadFixed, WriteFixed, RecvMsg, SendMsg, Accept and lifecycle states Idle, Submitted, Cancelling
  • Factory methods makeRead, makeReadFixed, makeWrite, makeWriteFixed, makeRecvmsg, makeSendmsg, makeAccept are implemented
  • ReadFixed and WriteFixed degrade silently to Read and Write on the reactor-backed proactor
  • Proactor::submit registers the fd with the reactor and transitions the op to Submitted
  • Proactor::cancel removes the fd from the reactor and transitions the op back to Idle
  • Proactor owns its Reactor instance
  • Proactor::run and Proactor::stop delegate to the owned Reactor
  • ProactorThread owns a Proactor and a background Thread, mirrors ReactorThread API (affinity, priority, handle, mlock)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions