On Thu, 1 Jun 2023 21:12:08 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> wrote:
> I think SegmentAllocator should be agnostic re. thread safety. Allocation is > a world of compromises, where if you give up (thread) safety you can gain > more performance (and viceversa). So I think having a "one size fits all" > thread-safety blanket might not work very well. I'm just trying to think about the practical implications of this. Arena is specified to be thread-safe so I can allocate from a non-confined Arena, and from concurrent threads, without needing to coordinate. However, if you hand me a SegmentAllocator that is not an Arena then I don't know if I need to coordinate allocation with other parties. I'm not too concerned about the slicingAllocator and prefixAllocator factory methods as the result SegmentAllocators will likely be wrapped. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14098#discussion_r1214092803