Resource efficient Thread Pools with Zig
kprotty.me·222w
Preview
Report Post

I’d like to share what I’ve been working on for the past 2 years give or take. It’s a thread pool that checks a bunch of boxes: lock-free, allocation-free* (excluding spawning threads), supports batch scheduling, and dynamically spawns threads while handling thread spawn failure.

To preface, this assumes you’re familiar with thread synchronization patterns and manual memory management. It’s also more of a letter to other people implementing schedulers than it is to benefit most programmers. So if you don’t understand what’s going on sometimes, that’s perfectly fine. I try to explain what led to each thought and if you’re just interested in how the claims above materialized, go read the source directly.

Thread Poo…

Similar Posts

Loading similar posts...