ADTast-experimentalpthread-emulationqualifiedEnum
Last change
on this file since 8419b76 was
a5d1fe7,
checked in by caparsons <caparson@…>, 3 years ago
|
added mutexStmt benchmarks
|
-
Property mode set to
100644
|
File size:
705 bytes
|
Line | |
---|
1 | #include <locks.hfa> |
---|
2 | #include <mutex_stmt.hfa> |
---|
3 | #include <stdio.h> |
---|
4 | |
---|
5 | #include "bench.h" |
---|
6 | |
---|
7 | test_spinlock l1, l2, l3, l4, l5, l6, l7, l8; |
---|
8 | |
---|
9 | int main( int argc, char * argv[] ) { |
---|
10 | BENCH_START() |
---|
11 | BENCH( |
---|
12 | for ( times ) { |
---|
13 | lock( l1 ); |
---|
14 | lock( l2 ); |
---|
15 | lock( l3 ); |
---|
16 | lock( l4 ); |
---|
17 | lock( l5 ); |
---|
18 | lock( l6 ); |
---|
19 | lock( l7 ); |
---|
20 | lock( l8 ); |
---|
21 | unlock( l8 ); |
---|
22 | unlock( l7 ); |
---|
23 | unlock( l6 ); |
---|
24 | unlock( l5 ); |
---|
25 | unlock( l4 ); |
---|
26 | unlock( l3 ); |
---|
27 | unlock( l2 ); |
---|
28 | unlock( l1 ); |
---|
29 | }, |
---|
30 | result |
---|
31 | ) |
---|
32 | printf( "%g\n", result ); |
---|
33 | } |
---|
34 | |
---|
35 | // Local Variables: // |
---|
36 | // tab-width: 4 // |
---|
37 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.