I am considering concurrent multi-producer multi-consumer data structure that has two methods: success = try_put(elem)
and success = try_get(&elem)
. I assume that this data structure has a fixed amount of preallocated memory and in case it is full or empty, success
boolean flag contains false
meaning that the corresponding operation can't be made.
The data structure doesn't enforce any ordering guarantees, so it doesn't matter is it a stack, queue, or something else. Does this data structure has some name in the literature?
Is it possible to make the wait-free implementation of this data structure? Does the presence of constant time atomic operations is required, if yes how they should be used?