Mindaugas Rasiukevicius
Mindaugas Rasiukevicius
My initial implementation was similar, but later I changed. The main reason is that I do not want the implementation to assume the use of threads. In fact, my primary...
OK, a few ideas: - We can add something like `ringbuf_adjust_workers()` which would change the `ringbuf_t::nworkers`. It can be incremented at any point. It can also be decremented, if concurrent...
- I can just re-iterate that the ringbuf implementation is solving a somewhat different problem. If you want message passing, then other algorithms can do a better job. Actually, I...
Your latest diff is conceptually nice design and a clean piece of code. Unfortunately, it is not efficient. Atomic operations are expensive. It depends a lot on a CPU (and...
Hi @yangsuli-netapp, What's your budget? :) I can write one taylored for your requirements. I do wonder, though, what problem are you solving with the SPMC ring buffer. -- Mindaugas
@riastradh: Thanks. However, I think `__HAVE_ATOMIC_AS_MEMBAR` is really ugly, error-prone and should better be removed. Can we just use C11 here? I would even use a plain atomic_fetch_add() / atomic_fetch_sub()...
@riastradh: I would encourage you to amend `atomic_{inc,dec}_uint{_nv,}` in NetBSD to include the memory barriers. Otherwise, such semantics makes code more error-prone and more verbose. It is not worth, especially...