1.1 --- a/dstest_test_client.cc Mon Mar 08 00:47:31 2021 +0100
1.2 +++ b/dstest_test_client.cc Thu Mar 11 23:49:04 2021 +0100
1.3 @@ -27,6 +27,7 @@
1.4 #include <stdlib.h>
1.5 #include <time.h>
1.6
1.7 +#include <system_error>
1.8 #include <thread>
1.9
1.10 #include <ipc/thread.h>
1.11 @@ -45,7 +46,7 @@
1.12 /* Test parameters unaffected by any capability limits. */
1.13
1.14 const unsigned int MAP_PAGES = 20;
1.15 -const unsigned int REGION_ITERATIONS = 10;
1.16 +const unsigned int REGION_ITERATIONS = 20;
1.17
1.18
1.19
1.20 @@ -190,12 +191,26 @@
1.21
1.22 /* Start threads accessing all the files. */
1.23
1.24 + printf("Starting threads...\n");
1.25 +
1.26 time_t t = time(NULL);
1.27 int current = 0;
1.28 + unsigned long errors = 0;
1.29
1.30 for (fileid = 0; fileid < NUMBER_OF_FILES; fileid++)
1.31 + {
1.32 for (unsigned int start_page = 0; start_page < START_LIMIT; start_page++)
1.33 - activities[current++] = new std::thread(activity_iterate, &contexts[fileid], fileid, start_page);
1.34 + {
1.35 + try
1.36 + {
1.37 + activities[current++] = new std::thread(activity_iterate, &contexts[fileid], fileid, start_page);
1.38 + }
1.39 + catch (const std::system_error &exc)
1.40 + {
1.41 + errors++;
1.42 + }
1.43 + }
1.44 + }
1.45
1.46 /* Wait for the threads. */
1.47
1.48 @@ -212,7 +227,7 @@
1.49 file_close(&contexts[fileid]);
1.50
1.51 t = time(NULL) - t;
1.52 - printf("Activities completed in %ld seconds.\n", t);
1.53 + printf("Activities completed in %ld seconds (with %ld threads not started).\n", t, errors);
1.54
1.55 return 0;
1.56 }