Using RCU in userland
Posted Jan 4, 2008 18:13 UTC (Fri) by PaulMcKenney
In reply to: Userland
Parent article: What is RCU, Fundamentally?
RCU has been used experimentally in user-mode code, and one benchmarking framework may be found at U. of Toronto.
In addition, I vaguely recall at least one user-level RCU implementation being posted on LKML as a programming/debugging aid. There are some others that I am unfortunately unable to release at this time.
As noted in an earlier comment, garbage-collected languages automatically provide much of the wait-for-reader functionality for free -- however, it is still necessary to correctly handle the publish-subscribe operation correctly. One way to do this in Java is to use the recently added "volatile" field specifier (no relation to "volatile" in C/C++) for the pointer that is being published. In other words, instead of using the Linux-kernel rcu_assign_pointer() and rcu_dereference() to publish and subscribe, you instead mark the pointer itself using Java's "volatile" keyword.
to post comments)