@paulmckrcu
Azul has the C4 GC which (I think) uses virtual memory mapping to implement the GC read barrier.
#RCU doesn't do compacting reclamation so memory fragmentation would kill you. But if you had a data structure what didn't do that, like a Michael-Scott #lockfree queue, you could use mmap memory protection to trap any stale references, trap the segfault to restart a restartable RCU locked region.
@paulmckrcu
The data structures don't need to be self compacting. Just all the memory objects have to be ephemeral, e.g. FIFO queue w/ linked nodes.
Malloc would be a get and increment form a block of memory.
free would be noop.
Restartable RCU w/ RSEQ might be a better choice than mprotect.
@paulmckrcu i worked at a place that ran time-based reclamation in userspace on ~1000 machines, for a while (: it's not stupid when it works!
@pkhuong @paulmckrcu that much reclamation latency surely has to translate into lots of memory overhead?
@tobinbaker @paulmckrcu depends on the update rate (and the ability to defer/batch/merge updates).
@paulmckrcu (we eventually switched to a more reasonable approach, but it did keep us afloat for a while)
@paulmckrcu
Depends on the data structure. For a lock-free queue, no RCU would be needed. You could do it w/ 3 interlocked ops for enqueue and 1 for dequeue. Not as good as a ring buffer though which only needs 2 interlocked ops for enqueue.
The memory management can be though of like arena memory but with a sliding window containing the live objects.