26 TEST(ParallelUtils, SpinLock) {
27 const int N = 1000000;
33 #pragma omp parallel for num_threads(4)
34 for (
int i = 0;
i < N;
i++) {
43 TEST(ParallelUtils, ReadWriteLock) {
44 const int N = 1000000;
51 #pragma omp parallel for num_threads(4)
52 for (
int i = 0;
i < N;
i++) {
67 TEST(ParallelUtils, OptimisticReadWriteLock) {
68 const int N = 1000000;
71 OptimisticReadWriteLock lock;
75 #pragma omp parallel for num_threads(4)
76 for (
int i = 0;
i < N;
i++) {
85 auto lease = lock.start_read();
88 succ = lock.end_read(lease);