Changeset 3d5701e for benchmark/basic/tls_fetch_add.c
- Timestamp:
- Feb 25, 2020, 1:17:33 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 7dc2e015
- Parents:
- 9fb8f01 (diff), dd9e1ca (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 moved
-
benchmark/basic/tls_fetch_add.c (moved) (moved from benchmark/tls-fetch_add.c ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/basic/tls_fetch_add.c
r9fb8f01 r3d5701e 3 3 4 4 #include "bench.h" 5 6 // Does not do a fetch & add. It mimics the cfa protocol to disable interrupts locally, by writing true or false to a 7 // thread_local Boolean. This means the entire protocol is just to "mov" instructions making it extremely cheap. 5 8 6 9 #define thread_local _Thread_local … … 16 19 } 17 20 18 int main(int argc, char* argv[]) { 21 int main( int argc, char * argv[] ) { 22 BENCH_START() 19 23 BENCH( 20 for (size_t i = 0; i < n; i++) {24 for (size_t i = 0; i < times; i++) { 21 25 do_call(); 22 26 }, 23 27 result 24 28 ) 29 printf( "%g\n", result ); 30 } 25 31 26 printf("%g\n", result); 27 } 32 // Local Variables: // 33 // tab-width: 4 // 34 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.