ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumwith_gc
Last change
on this file since 5510027 was
034165a,
checked in by Thierry Delisle <tdelisle@…>, 7 years ago
|
renamed and updated benchmarks for consistency
|
-
Property mode set to
100644
|
File size:
441 bytes
|
Rev | Line | |
---|
[034165a] | 1 | #include <pthread.h> |
---|
| 2 | #include <stdio.h> |
---|
| 3 | |
---|
| 4 | #include "bench.h" |
---|
| 5 | |
---|
| 6 | static void *foo(void *arg) { |
---|
| 7 | return arg; |
---|
| 8 | } |
---|
| 9 | |
---|
| 10 | int main(int argc, char* argv[]) { |
---|
| 11 | BENCH( |
---|
| 12 | for (size_t i = 0; i < n; i++) { |
---|
| 13 | pthread_t thread; |
---|
| 14 | if (pthread_create(&thread, NULL, foo, NULL) < 0) { |
---|
| 15 | perror( "failure" ); |
---|
| 16 | return 1; |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | if (pthread_join( thread, NULL) < 0) { |
---|
| 20 | perror( "failure" ); |
---|
| 21 | return 1; |
---|
| 22 | } |
---|
| 23 | }, |
---|
| 24 | result |
---|
| 25 | ) |
---|
| 26 | |
---|
| 27 | printf("%llu\n", result); |
---|
| 28 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.