bbqueue icon indicating copy to clipboard operation
bbqueue copied to clipboard

MPSC Support Possible?

Open sphw opened this issue 3 years ago • 0 comments

I might be missing something very obvious here, but it seems to me that BBQueue is very well setup to act as an MPSC queue. When taking a grant there is already a "lock" of sorts with write_in_progress. It seems like you could create a function that allows for the creation of multiple producers from the same underlying buffer. Something similar to https://github.com/jamesmunns/bbqueue/pull/78 would work. Of course this would make writes effectively have a lock, but there are cases where that might be an acceptable trade-off.

Are there any safety issues with the approach I outlined above, or other trade-offs I might have missed?

sphw avatar Dec 12 '22 22:12 sphw