Source
- URL: https://x.com/NOTimothyLottes/status/1873749894437187586
- Author: NOTimothyLottes (@NOTimothyLottes)
- Posted: 2024-12-30 15:16:02
Branch
1/ @NOTimothyLottes
@bmcnett
There is another way, one can group items and just do counting per group, release the whole group only when all items in group are ready
2/ @bmcnett
@NOTimothyLottes
that’s trivial for a multi producer single consumer, how do you do it simply for a multi consumer?
3/ @NOTimothyLottes
@bmcnett
Here is an idea how to do it via minimal atomics. 2M max items per frame. Tune group size to machine, and have the producers start ahead enough, and the (lock-free) spins likely won’t happen in practice … (if on GPU then optimize the atomicAdd()‘s, etc)
4/ @bmcnett
@NOTimothyLottes
ah, ok i get it now. i don’t spin inside API, so user can decide when they want to be wait-free
5/ @NOTimothyLottes
@bmcnett
Yeah, exactly that, there are many optimizations possible. Like producers can amortize to one atomic per group to advance ready. Producers could queue the group locally if it isn’t active and keep going. Etc.