News for hackers. Stuff that matters.
Re:A Comparison of Arenas in Rust by eigenspace on Sunday August 25, 2024 @04:32PM (#41351122)
Not totally sure what you're looking for, but what I did when I made a package for arena allocators in Julia, I made the arena task-local rather than global.

That means that if you spawn a concurrent task and then request the arena to allocate something to, you'll be writing to a completely separate chunk of memory than the memory used by the arena in the parent task.

Users can still cause race conditions by explicitly passing an existing arena across task boundaries, but if they use the function to fetch the currently-active task-local allocator, it's naturally threadsafe without any slow locks or atomics required.

Ref: https://github.com/MasonProtter/Bumper.jl

There are no comments on this comment yet.