#debug
#CFLAGS=-Wall -g
-#CFLAGS+=-DDEBUG_FULL_MB
+
+#Build the library without using signals. Slower read-side.
+#CFLAGS+=-DCONFIG_URCU_AVOID_SIGNALS
#Changing the signal number used by the library. SIGUSR1 by default.
#CFLAGS+=-DSIGURCU=SIGUSR2
$(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
test_urcu_mb: urcu-mb.o test_urcu.c urcu.h
- $(CC) -DDEBUG_FULL_MB ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
+ $(CC) -DCONFIG_URCU_AVOID_SIGNALS ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
test_urcu_gc: urcu.o test_urcu_gc.c urcu.h
$(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
test_urcu_gc_mb: urcu-mb.o test_urcu_gc.c urcu.h
- $(CC) -DDEBUG_FULL_MB ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
+ $(CC) -DCONFIG_URCU_AVOID_SIGNALS ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
test_urcu_lgc: urcu.o test_urcu_gc.c urcu.h
$(CC) -DTEST_LOCAL_GC ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
test_urcu_lgc_mb: urcu-mb.o test_urcu_gc.c urcu.h
- $(CC) -DTEST_LOCAL_GC -DDEBUG_FULL_MB ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
+ $(CC) -DTEST_LOCAL_GC -DCONFIG_URCU_AVOID_SIGNALS ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
test_qsbr: urcu-qsbr.o test_qsbr.c urcu-qsbr.h
$(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
$(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
urcu-mb.o: urcu.c urcu.h
- $(CC) -fPIC -DDEBUG_FULL_MB ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
+ $(CC) -fPIC -DCONFIG_URCU_AVOID_SIGNALS ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
urcu-qsbr.o: urcu-qsbr.c urcu-qsbr.h
$(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
#debug
#CFLAGS=-m64 -Wall -g
-#CFLAGS+=-DDEBUG_FULL_MB
+
+#Build the library without using signals. Slower read-side.
+#CFLAGS+=-DCONFIG_URCU_AVOID_SIGNALS
#Changing the signal number used by the library. SIGUSR1 by default.
#CFLAGS+=-DSIGURCU=SIGUSR2
$(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
test_urcu_mb: urcu-mb.o test_urcu.c urcu.h
- $(CC) -DDEBUG_FULL_MB ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
+ $(CC) -DCONFIG_URCU_AVOID_SIGNALS ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
test_urcu_gc: urcu.o test_urcu_gc.c urcu.h
$(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
test_urcu_gc_mb: urcu-mb.o test_urcu_gc.c urcu.h
- $(CC) -DDEBUG_FULL_MB ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
+ $(CC) -DCONFIG_URCU_AVOID_SIGNALS ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
test_urcu_lgc: urcu.o test_urcu_gc.c urcu.h
$(CC) -DTEST_LOCAL_GC ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
test_urcu_lgc_mb: urcu-mb.o test_urcu_gc.c urcu.h
- $(CC) -DTEST_LOCAL_GC -DDEBUG_FULL_MB ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
+ $(CC) -DTEST_LOCAL_GC -DCONFIG_URCU_AVOID_SIGNALS ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
test_qsbr: urcu-qsbr.o test_qsbr.c urcu-qsbr.h
$(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
$(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
urcu-mb.o: urcu.c urcu.h
- $(CC) -fPIC -DDEBUG_FULL_MB ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
+ $(CC) -fPIC -DCONFIG_URCU_AVOID_SIGNALS ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
urcu-qsbr.o: urcu-qsbr.c urcu-qsbr.h
$(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
some non-restartable system calls to fail with errno = EINTR. Care
should be taken to restart system calls manually if they fail with this
error. A list of non-restartable system calls may be found in
- signal(7).
+ signal(7). To ensure the Userspace RCU library does not use signals,
+ define CONFIG_URCU_AVOID_SIGNALS at compile-time.
-Usage of DEBUG_FULL_MB
+Usage of CONFIG_URCU_AVOID_SIGNALS
- DEBUG_FULL_MB uses full SMP barriers for readers. This eliminates the
- need for signals but results in slower reads.
+ CONFIG_URCU_AVOID_SIGNALS uses full SMP barriers for readers. This
+ eliminates the need for signals but results in slower reads.
Usage of DEBUG_YIELD
DEBUG_YIELD is used to add random delays in the code for testing
purposes.
-
#define YIELD_READ (1 << 0)
#define YIELD_WRITE (1 << 1)
-/* Updates without DEBUG_FULL_MB are much slower. Account this in the delay */
-#ifdef DEBUG_FULL_MB
+/*
+ * Updates without CONFIG_URCU_AVOID_SIGNALS are much slower. Account this in
+ * the delay.
+ */
+#ifdef CONFIG_URCU_AVOID_SIGNALS
/* maximum sleep delay, in us */
#define MAX_SLEEP 50
#else
}
#endif
-#ifdef DEBUG_FULL_MB
+#ifdef CONFIG_URCU_AVOID_SIGNALS
static inline void reader_barrier()
{
smp_mb();
/* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */
#include "urcu.h"
-#ifndef DEBUG_FULL_MB
+#ifndef CONFIG_URCU_AVOID_SIGNALS
void __attribute__((constructor)) urcu_init(void);
void __attribute__((destructor)) urcu_exit(void);
#else
STORE_SHARED(urcu_gp_ctr, urcu_gp_ctr ^ RCU_GP_CTR_BIT);
}
-#ifdef DEBUG_FULL_MB
+#ifdef CONFIG_URCU_AVOID_SIGNALS
#ifdef HAS_INCOHERENT_CACHES
static void force_mb_single_thread(struct reader_registry *index)
{
{
smp_mb();
}
-#else /* #ifdef DEBUG_FULL_MB */
+#else /* #ifdef CONFIG_URCU_AVOID_SIGNALS */
#ifdef HAS_INCOHERENT_CACHES
static void force_mb_single_thread(struct reader_registry *index)
{
}
smp_mb(); /* read ->need_mb before ending the barrier */
}
-#endif /* #else #ifdef DEBUG_FULL_MB */
+#endif /* #else #ifdef CONFIG_URCU_AVOID_SIGNALS */
void wait_for_quiescent_state(void)
{
internal_urcu_unlock();
}
-#ifndef DEBUG_FULL_MB
+#ifndef CONFIG_URCU_AVOID_SIGNALS
static void sigurcu_handler(int signo, siginfo_t *siginfo, void *context)
{
/*
assert(act.sa_sigaction == sigurcu_handler);
free(registry);
}
-#endif /* #ifndef DEBUG_FULL_MB */
+#endif /* #ifndef CONFIG_URCU_AVOID_SIGNALS */