{"id":29634964,"url":"https://github.com/eldment/win-async","last_synced_at":"2025-07-21T16:08:35.446Z","repository":{"id":304372953,"uuid":"1018602850","full_name":"ELDment/Win-Async","owner":"ELDment","description":"⏳ C++17 Concurrent Programming Implementation","archived":false,"fork":false,"pushed_at":"2025-07-20T03:38:11.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-20T04:46:09.610Z","etag":null,"topics":["async","concurrency","concurrent-programming","coroutines","cpp17","cxx17","modern-cpp"],"latest_commit_sha":null,"homepage":"https://github.com/ELDment/Win-Async","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ELDment.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-12T16:08:26.000Z","updated_at":"2025-07-20T03:39:12.000Z","dependencies_parsed_at":"2025-07-12T18:51:29.003Z","dependency_job_id":null,"html_url":"https://github.com/ELDment/Win-Async","commit_stats":null,"previous_names":["eldment/cpp-coroutine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ELDment/Win-Async","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ELDment%2FWin-Async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ELDment%2FWin-Async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ELDment%2FWin-Async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ELDment%2FWin-Async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ELDment","download_url":"https://codeload.github.com/ELDment/Win-Async/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ELDment%2FWin-Async/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266332634,"owners_count":23912663,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","concurrency","concurrent-programming","coroutines","cpp17","cxx17","modern-cpp"],"created_at":"2025-07-21T16:08:34.963Z","updated_at":"2025-07-21T16:08:35.438Z","avatar_url":"https://github.com/ELDment.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💻 Win-Async\n\n[简体中文项目介绍](README.zh-CN.md)\n\nA C++ coroutine library implemented based on `Windows Fiber`, `VEH`, `IOCP`, and `C++17`\n\n\u003e ⚠️ This is a **learning project** aimed at exploring the underlying mechanisms of coroutine scheduling, context switching, and exception handling. Since the core implementation relies on Windows Fiber, this project **only supports the Windows platform**. Additionally, this project does not provide production-level performance optimizations or long-term community support\n\n## ✨ Core Features\n\n- 🚀 **Powerful Hybrid Scheduling Model**\n  - 🤝 **Cooperative I/O Coroutines**: Integrates `IOCP` to elegantly handle high-concurrency, non-blocking I/O operations\n  - ⚡ **Parallel CPU-Bound Tasks**: A built-in thread pool allows offloading high-latency tasks via `RunOnThreadPool`, preventing them from blocking the main I/O event loop\n\n- 💻 **Modern Asynchronous API (`Task`/`Await`)**\n  - 💡 **Synchronous-Style Coding**: Write asynchronous logic that reads like synchronous code using `CreateTask` and `Await`\n  - 🎁 **Seamless Result \u0026 Exception Propagation**: `Task\u003cT\u003e` transparently delivers results or exceptions from any coroutine (whether an I/O coroutine or a thread pool task) to the caller\n\n- 🛡️ **Robust Exception Safety**\n  - 📦 **Unified Exception Handling**: Automatically captures exceptions from any context (Fiber or thread pool) using Vectored Exception Handling (VEH) and safely propagates them through the `Promise`\n\n## 🔧 How It Works\n\n- **Context Switching**: Based on the Windows `Fiber` API\n- **Exception Handling**: Utilizes Vectored Exception Handling (`VEH`)\n- **Scheduling Loop**: An **IOCP-driven** event loop that unifies coroutine scheduling, timers, and asynchronous I/O events\n\n## 🛠️ Quick Start\n\n### Using xmake\n\n```powershell\n# Configure build options (Release mode)\nxmake f -m release\n\n# Build the project\nxmake\n\n# Run the benchmark\nxmake run benchmark\n```\n\n### Using CMake\n\n```powershell\n# Create and enter the build directory\nmkdir build; cd build\n\n# Generate the build system\ncmake ..\n\n# Build the project (Release mode)\ncmake --build . --config Release\n\n# Run the benchmark\n./Release/benchmark.exe\n```\n\n## 🗺️ TODO\n\n### 🚀 Cpp-Coroutine Development Roadmap\n\n| Priority | Category | Key Tasks |\n| :---: | :--- | :--- |\n| ⚡⚡ | **Fiber-based Task/Await** | [√] Design `Task\u003cT\u003e`\u003cbr\u003e[√] Implement `Await` |\n| ⚡⚡⚡⚡ | **Scheduler \u0026 Concurrency** | [√] Multi-threaded scheduler\u003cbr\u003e[√] Integrate IOCP |\n| ⚡⚡ | **Coroutine Sync Primitives** | [ ] Async Mutex (`AsyncMutex`)\u003cbr\u003e[ ] Async Semaphore (`AsyncSemaphore`)\u003cbr\u003e[ ] Combinators (`WhenAll` / `WhenAny`) |\n| ⚡ | **API** | [ ] Cooperative Cancellation (`CancellationToken`) |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldment%2Fwin-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldment%2Fwin-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldment%2Fwin-async/lists"}