Skip to content

IOCP support (again)#452

Draft
PyXiion wants to merge 6 commits intojbaldwin:mainfrom
PyXiion:ioco
Draft

IOCP support (again)#452
PyXiion wants to merge 6 commits intojbaldwin:mainfrom
PyXiion:ioco

Conversation

@PyXiion
Copy link
Contributor

@PyXiion PyXiion commented Mar 12, 2026

Well, there's a lot of work to do to do that.

Right now I need to write/rewrite these things:

  • io_notifier_iocp
  • pipe_t: rename it to wake_source or something like that, and implement it on Windows via PostQueuedCompletionStatus and custom completion keys
  • poll_info & poll_op
  • timer_handle:
    1. std::multimap/std::set with timers, and calculate dynamic timeout for GQCS(iocp, ..., timeout_ms).
      On new timer wake IOCP queue with PQCS(..., TIMER_WAKE_KEY, nullptr).
      • Pros: one thread, no thread pool
      • Cons: heap usage, possibly bad performance with many timers, maybe precision loss
    2. CreateThreadpoolTimer + PostQueuedCompletionStatus from the callback
      • Pros: OS will manage it itself, high precision, simpler code
      • Cons: overhead for short timers, thread pool used
    3. CreateWaitableTimer + dedicated waiter thread
      • Pros: super duper simple
      • Cons: extra thread and overall bad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant