Skip to main content

Module io

Module io 

Source
Expand description

Thread-pool I/O (TP_IO): a completion backend over the shared overlapped submission seam.

ThreadpoolIo is the third completion backend for the overlapped model defined by windows-overlapped-io-sys. It reuses that crate’s endpoint ownership and pinned Operation storage unchanged, and adds the two concerns that only the thread pool has:

  • Balanced accounting. StartThreadpoolIo must precede every overlapped operation, and every start must be balanced exactly once – by the I/O callback when a completion will be delivered, or by CancelThreadpoolIo when the submission failed immediately or completed synchronously on a handle in FILE_SKIP_COMPLETION_PORT_ON_SUCCESS mode.
  • Callback-driven reclamation. The pool, not the caller, dequeues completions. Each callback reclaims its operation’s storage: typed through IoCompletion::claim when the payload type is known, or generically through the seam’s reclaim_overlapped when the callback lets the completion drop.

The pool’s internal completion port is system-managed and is never exposed: this backend neither posts to it nor dequeues from it.

Structs§

IoCompletion
One operation completion delivered to a ThreadpoolIo callback.
ThreadpoolIo
An owned thread-pool I/O object bound to one overlapped endpoint.