Hi, all
We're investigating if DPDK can use userspace RCU in case lock is unavoidable,
DPDK is released under BSD license, urcu is released under LGPL license, so
DPDK can use liburcu without any license issue. Here is my pseudo code which
uses liburcu to protect a shared global struct.
Global struct
struct vhost_mem_info * mem;
Reader thread:
#define URCU_INLINE_SMALL_FUNCTIONS
#include <urcu.h>
rcu_register_thread();
while (1) {
rcu_read_lock();
/* Read info in mem */
rcu_read_unlock();
}
rcu_unregister_thread();
There are multiple reader threads.
Writer thread:
#define URCU_INLINE_SMALL_FUNCTIONS
#include <urcu.h>
void main(int argc, char *argv[])
{
while (has_mem_hotplug) {
synchronize_rcu();
/* update info in mem */
}
rcu_barrier();
}
My question is `can such urcu usage protect "struct vhost_mem_info * mem"
correctly`, it seems urcu hasn't an explicit way to identify what it will
protect, I'll appreciate you if you can show me how to protect "struct
vhost_mem_info * mem" for my use case, thank you all in advance for your kind
help.
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev