Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kassane/asio-zig
asio (standalone) event-loop to C API - Experimental (uses zig 0.12.0)
https://github.com/kassane/asio-zig
asio asio-library asynchronous c concurrency cplusplus cpp ffi-bindings threading zig
Last synced: 4 months ago
JSON representation
asio (standalone) event-loop to C API - Experimental (uses zig 0.12.0)
- Host: GitHub
- URL: https://github.com/kassane/asio-zig
- Owner: kassane
- License: mit
- Created: 2023-06-05T13:12:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-12T13:14:11.000Z (11 months ago)
- Last Synced: 2024-10-05T15:59:26.743Z (4 months ago)
- Topics: asio, asio-library, asynchronous, c, concurrency, cplusplus, cpp, ffi-bindings, threading, zig
- Language: C++
- Homepage:
- Size: 28.3 KB
- Stars: 4
- Watchers: 0
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Asio C Wrapper - Event-loop
The wrapper provides functions for initializing the ASIO library, running it, stopping it, and posting tasks to be executed asynchronously within the event-loop. It handles the necessary conversions and memory management required to interface with ASIO from C or Zig code. Additionally, it utilizes ASIO's thread pool (`asio::static_thread_pool`) for multithreading support, allowing tasks to be executed concurrently on multiple threads.
### How to build and run
* Need [zig 0.12.0](https://ziglang.org/download) or higher.
```bash
# Zig binding test (only)
$> zig build test# Build all C examples
$> zig build -Doptimize={option} # to debug no need `-Doptimize` flag
```
**Note:** `{option} == Debug (default) | ReleaseSafe | ReleaseFast | ReleaseSmall`