Would a generalized version of the Queue abstraction in bench.rs would be a good idea - maybe one based on producers/consumers? This would make defining functions which generically operate on a queue type easier and standardized. To take it further, a set of traits based on (mp/sp) + (sc/mc) and maybe other properties would make the queue type needed by a function self documenting and give better error messages when the wrong queue type was passed - for instance, the error is on a spsc queue with too many consumers is:
the trait core::marker::Sync is not implemented for the type *mut i64
with SpscBufferQueue mentioned briefly in the explanation. In a large codebase, I would probably have little idea what was going on.
Would a generalized version of the Queue abstraction in bench.rs would be a good idea - maybe one based on producers/consumers? This would make defining functions which generically operate on a queue type easier and standardized. To take it further, a set of traits based on (mp/sp) + (sc/mc) and maybe other properties would make the queue type needed by a function self documenting and give better error messages when the wrong queue type was passed - for instance, the error is on a spsc queue with too many consumers is:
the trait
core::marker::Syncis not implemented for the type*mut i64with SpscBufferQueue mentioned briefly in the explanation. In a large codebase, I would probably have little idea what was going on.