static unsigned long duration;
+/* read-side C.S. duration, in us */
+static unsigned long rduration;
+
/*
* returns 0 if test should end.
*/
for (;;) {
pthread_mutex_lock(&lock);
assert(test_array.a == 8);
+ if (unlikely(rduration))
+ usleep(rduration);
pthread_mutex_unlock(&lock);
nr_reads++;
if (unlikely(!test_duration_read()))
printf(" [-r] [-w] (yield reader and/or writer)");
#endif
printf(" [-d delay] (writer period (us))");
+ printf(" [-c duration] (reader C.S. duration (us))");
printf(" [-a cpu#] [-a cpu#]... (affinity)");
printf("\n");
}
use_affinity = 1;
printf("Adding CPU %d affinity\n", a);
break;
+ case 'c':
+ if (argc < i + 2) {
+ show_usage(argc, argv);
+ return -1;
+ }
+ rduration = atoi(argv[++i]);
+ break;
case 'd':
if (argc < i + 2) {
show_usage(argc, argv);
static unsigned long duration;
+/* read-side C.S. duration, in us */
+static unsigned long rduration;
+
/*
* returns 0 if test should end.
*/
for (;;) {
pthread_mutex_lock(&per_thread_lock[tidx].lock);
assert(test_array.a == 8);
+ if (unlikely(rduration))
+ usleep(rduration);
pthread_mutex_unlock(&per_thread_lock[tidx].lock);
nr_reads++;
if (unlikely(!test_duration_read()))
printf(" [-r] [-w] (yield reader and/or writer)");
#endif
printf(" [-d delay] (writer period (us))");
+ printf(" [-c duration] (reader C.S. duration (us))");
printf(" [-a cpu#] [-a cpu#]... (affinity)");
printf("\n");
}
use_affinity = 1;
printf("Adding CPU %d affinity\n", a);
break;
+ case 'c':
+ if (argc < i + 2) {
+ show_usage(argc, argv);
+ return -1;
+ }
+ rduration = atoi(argv[++i]);
+ break;
case 'd':
if (argc < i + 2) {
show_usage(argc, argv);
static unsigned long duration;
+/* read-side C.S. duration, in us */
+static unsigned long rduration;
+
/*
* returns 0 if test should end.
*/
debug_yield_read();
if (local_ptr)
assert(local_ptr->a == 8);
+ if (unlikely(rduration))
+ usleep(rduration);
_rcu_read_unlock();
nr_reads++;
/* QS each 1024 reads */
printf(" [-r] [-w] (yield reader and/or writer)");
#endif
printf(" [-d delay] (writer period (us))");
+ printf(" [-c duration] (reader C.S. duration (us))");
printf(" [-a cpu#] [-a cpu#]... (affinity)");
printf("\n");
}
use_affinity = 1;
printf("Adding CPU %d affinity\n", a);
break;
+ case 'c':
+ if (argc < i + 2) {
+ show_usage(argc, argv);
+ return -1;
+ }
+ rduration = atoi(argv[++i]);
+ break;
case 'd':
if (argc < i + 2) {
show_usage(argc, argv);
static unsigned long duration;
+/* read-side C.S. duration, in us */
+static unsigned long rduration;
+
/*
* returns 0 if test should end.
*/
for (;;) {
pthread_rwlock_rdlock(&lock);
assert(test_array.a == 8);
+ if (unlikely(rduration))
+ usleep(rduration);
pthread_rwlock_unlock(&lock);
nr_reads++;
if (unlikely(!test_duration_read()))
printf(" [-r] [-w] (yield reader and/or writer)");
#endif
printf(" [-d delay] (writer period (us))");
+ printf(" [-c duration] (reader C.S. duration (us))");
printf(" [-a cpu#] [-a cpu#]... (affinity)");
printf("\n");
}
use_affinity = 1;
printf("Adding CPU %d affinity\n", a);
break;
+ case 'c':
+ if (argc < i + 2) {
+ show_usage(argc, argv);
+ return -1;
+ }
+ rduration = atoi(argv[++i]);
+ break;
case 'd':
if (argc < i + 2) {
show_usage(argc, argv);
static unsigned long duration;
+/* read-side C.S. duration, in us */
+static unsigned long rduration;
+
/*
* returns 0 if test should end.
*/
debug_yield_read();
if (local_ptr)
assert(local_ptr->a == 8);
+ if (unlikely(rduration))
+ usleep(rduration);
rcu_read_unlock();
nr_reads++;
if (unlikely(!test_duration_read()))
printf(" [-r] [-w] (yield reader and/or writer)");
#endif
printf(" [-d delay] (writer period (us))");
+ printf(" [-c duration] (reader C.S. duration (us))");
printf(" [-a cpu#] [-a cpu#]... (affinity)");
printf("\n");
}
use_affinity = 1;
printf("Adding CPU %d affinity\n", a);
break;
+ case 'c':
+ if (argc < i + 2) {
+ show_usage(argc, argv);
+ return -1;
+ }
+ rduration = atoi(argv[++i]);
+ break;
case 'd':
if (argc < i + 2) {
show_usage(argc, argv);