#include <assert.h>
#include <sys/syscall.h>
+#include "arch.h"
+
#if defined(_syscall0)
_syscall0(pid_t, gettid)
#elif defined(__NR_gettid)
while (!test_go)
{
}
+ smp_mb();
for (;;) {
_rcu_read_lock();
while (!test_go)
{
}
+ smp_mb();
for (;;) {
new = test_array_alloc();
#ifdef DEBUG_YIELD
printf(" [-r] [-w] (yield reader and/or writer)");
#endif
- printf(" [-d delay] (writer period)");
+ printf(" [-d delay] (writer period (us))");
printf("\n");
}
printf("running test for %lu seconds, %u readers, %u writers.\n",
duration, nr_readers, nr_writers);
printf("Writer delay : %u us.\n", wdelay);
- start_time = time(NULL);
printf("thread %-6s, thread id : %lx, tid %lu\n",
"main", pthread_self(), (unsigned long)gettid());
exit(1);
}
+ start_time = time(NULL);
test_go = 1;
+ smp_mb();
for (i = 0; i < nr_readers; i++) {
err = pthread_join(tid_reader[i], &tret);
#include <assert.h>
#include <sys/syscall.h>
+#include "arch.h"
+
#if defined(_syscall0)
_syscall0(pid_t, gettid)
#elif defined(__NR_gettid)
while (!test_go)
{
}
+ smp_mb();
for (;;) {
pthread_rwlock_wrlock(&lock);
#ifdef DEBUG_YIELD
printf(" [-r] [-w] (yield reader and/or writer)");
#endif
- printf(" [-d delay] (writer period)");
+ printf(" [-d delay] (writer period (us))");
printf("\n");
}
show_usage(argc, argv);
return -1;
}
+ smp_mb();
err = sscanf(argv[1], "%u", &nr_readers);
if (err != 1) {
printf("running test for %lu seconds, %u readers, %u writers.\n",
duration, nr_readers, nr_writers);
printf("Writer delay : %u us.\n", wdelay);
- start_time = time(NULL);
printf("thread %-6s, thread id : %lx, tid %lu\n",
"main", pthread_self(), (unsigned long)gettid());
exit(1);
}
+ start_time = time(NULL);
test_go = 1;
+ smp_mb();
for (i = 0; i < nr_readers; i++) {
err = pthread_join(tid_reader[i], &tret);
#include <assert.h>
#include <sys/syscall.h>
+#include "arch.h"
+
#if defined(_syscall0)
_syscall0(pid_t, gettid)
#elif defined(__NR_gettid)
while (!test_go)
{
}
+ smp_mb();
for (;;) {
rcu_read_lock();
while (!test_go)
{
}
+ smp_mb();
for (;;) {
new = test_array_alloc();
#ifdef DEBUG_YIELD
printf(" [-r] [-w] (yield reader and/or writer)");
#endif
- printf(" [-d delay] (writer period)");
+ printf(" [-d delay] (writer period (us))");
printf("\n");
}
break;
#endif
case 'd':
- if (argc < i + 1) {
+ if (argc < i + 2) {
show_usage(argc, argv);
return -1;
}
printf("running test for %lu seconds, %u readers, %u writers.\n",
duration, nr_readers, nr_writers);
printf("Writer delay : %u us.\n", wdelay);
- start_time = time(NULL);
printf("thread %-6s, thread id : %lx, tid %lu\n",
"main", pthread_self(), (unsigned long)gettid());
exit(1);
}
+ start_time = time(NULL);
test_go = 1;
+ smp_mb();
for (i = 0; i < nr_readers; i++) {
err = pthread_join(tid_reader[i], &tret);