ADTast-experimental
Last change
on this file since 0da7181 was
6e6989c,
checked in by caparsons <caparson@…>, 16 months ago
|
added mutex stmt benchmarking
|
-
Property mode set to
100644
|
File size:
518 bytes
|
Line | |
---|
1 | #include <locks.hfa> |
---|
2 | #include <mutex_stmt.hfa> |
---|
3 | #include <stdio.h> |
---|
4 | |
---|
5 | #include "../bench.h" |
---|
6 | |
---|
7 | test_spinlock LOCKS; |
---|
8 | |
---|
9 | bool done = false; |
---|
10 | uint64_t total = 0; |
---|
11 | thread worker {}; |
---|
12 | void main( worker & w ) { |
---|
13 | BENCH( mutex ( LOCKS ) { }, total, done ) |
---|
14 | } |
---|
15 | |
---|
16 | int main( int argc, char * argv[] ) { |
---|
17 | BENCH_START() |
---|
18 | processor p[threads]; // one extra for main thread |
---|
19 | { |
---|
20 | worker w[threads]; |
---|
21 | sleep( 10`s ); |
---|
22 | done = true; |
---|
23 | } |
---|
24 | printf( "%lu\n", total ); |
---|
25 | } |
---|
26 | |
---|
27 | // Local Variables: // |
---|
28 | // tab-width: 4 // |
---|
29 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.