Memory-Optimality for Non-Blocking Containers

04/30/2021
by   Vitaly Aksenov, et al.
0

A bounded container maintains a collection of elements that can be inserted and extracted as long as the number of stored elements does not exceed the predefined capacity. We consider the concurrent implementations of a bounded container more or less memory-friendly depending on how much memory they use in addition to storing the elements. This way, memory-optimal implementation employs the minimal possible memory overhead and ensures that data and metadata are stored most compactly, reducing cache misses and unnecessary memory reclamation. In this paper, we show that non-blocking implementations of a large class of element-independent bounded containers, including queues, stacks, and pools, must incur linear in the number of concurrent processes memory overhead. In the special cases when the ABA problem is excluded, e.g., by assuming that the hardware supports LL/SC instructions or by storing distinct elements, we show that the lower bound can be circumvented, by presenting lock-free bounded queues with constant memory overhead. For the general case, we present a CAS-based bounded queue implementation that asymptotically matches our lower bound. We believe that these results open a new research avenue devoted to the memory-optimality phenomenon.

READ FULL TEXT

Please sign up or login with your details

Forgot password? Click here to reset