Cloudef / zig-aio

io_uring like asynchronous API and coroutine powered IO tasks for zig
https://cloudef.github.io/zig-aio/
MIT License
175 stars 6 forks source link

coro/aio: custom stack allocator for scheduler and custom closure allocator for DynamicThreadPool #2

Open Cloudef opened 4 months ago

Cloudef commented 4 months ago

It is likely when using scheduler, the stack sizes for coroutines don't change often, thus we can reuse the allocated stacks. Similarly the closure for dynamic thread pool is unlikely to change that often.

Ideally if stack sizes never change, the performance should be something similar to using std.heap.MemoryPool for unmanaged stacks.