All of lore.kernel.org
 help / color / mirror / Atom feed
* Can anybody help check if such urcu usage is correct?
@ 2017-10-12  8:29 Yang, Yi Y
  0 siblings, 0 replies; only message in thread
From: Yang, Yi Y @ 2017-10-12  8:29 UTC (permalink / raw)
  To: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 1397 bytes --]

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.

[-- Attachment #1.2: Type: text/html, Size: 6479 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-12  8:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12  8:29 Can anybody help check if such urcu usage is correct? Yang, Yi Y

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.