How facebookexperimental/libunifex works
Main Components
a) Core Components:
• Sender/Receiver Framework
• Schedulers System
• Async I/O System
• Coroutine Integration Layer
• Stream Processing System
• Cancellation System
b) Platform-Specific Components:
• Linux I/O Implementation (io_uring)
• Windows Implementation (IOCP, Thread Pool)
┌─────────────────── Application Layer ───────────────────┐
• (User Code) │
• High-Level APIs ──────────────────┐ │
• Algorithms │ │
• Async Streams │ │
• Coroutine Integration │ │
• Core Layer ─────────────────────┐ │ │
• Sender/Receiver Framework │ │ │
• Schedulers │ │ │
• Cancellation System │ │ │
• Platform Abstraction Layer ────────┐ │ │ │
• Linux Support │ Windows Support │ │ │ │
• io_uring │ - IOCP │ │ │ │
• epoll │ - Thread Pool │ │ │ │
• ┘
Key Elements to Highlight
a) Core Abstractions:
• Cancellation paths
• Scheduler interaction points
b) Cross-cutting Concerns:
• Type erasure mechanisms
• Memory management
• Error handling
• Debugging facilities
Implementation Details
• Scheduler implementations (static_thread_pool, inline_scheduler, etc.)
• Stream processing components
• Async primitives (mutex, events)
• Platform-specific I/O implementations
Notes for Implementation
• Keep the abstraction level high enough to show the architecture but detailed enough to understand the system's working
• Clear boundaries between platform-specific and platform-independent code
• Extensibility points where users can plug in their implementations
• Version compatibility notes where relevant
• Clear text labels
• Export to high-resolution formats
Remember to maintain consistency with the project's modular structure as seen in the include/unifex directory, and reflect the test organization shown in the test directory.