Ant Farm - A concurrent M:N jobs distributor

Nathan Riddick nathan.judge at gmail.com
Mon Aug 24 23:04:33 UTC 2026


Hello, I had an idea for a non-FIFO concurrent callback-jobs 
thing based on a ring buffer. It seems to have strong performance 
and utility for my next set of tinkerings. I came up with ~90% of 
the spec and made some attempts at a clean implementation, but 
Kimi K3 ultimately came through with an initial clean version and 
various other LLMs were very useful at grinding out late-night 
debug sessions with infinite patience.

tl;dr synthetic throughput sits between moodycamel no-tokens and 
with-tokens at a few million items/sec, seems to prefer more 
concurrency rather than less, the latency at reaching one-more 
item after a big block of work crushes FIFO designs generally, 
it's adaptive to a homogenous thread pool that shrinks or grows 
over time, API is @nogc nothrow @system and probably thread-safe.

https://github.com/nriddick/antfarm


More information about the Digitalmars-d mailing list