Changeset beefc34c for src/tests/preempt_longrun
- Timestamp:
- Jun 7, 2018, 6:12:11 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 6eb131c, 7b28e4a
- Parents:
- 174845e (diff), 85b1deb (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. - Location:
- src/tests/preempt_longrun
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/preempt_longrun/enter.c
r174845e rbeefc34c 15 15 16 16 monitor mon_t {}; 17 void foo( mon_t & mutex this ) {} 17 18 18 19 mon_t mon; 19 20 void foo( mon_t & mutex this ) {}21 22 20 thread worker_t {}; 23 24 21 void main( worker_t & this ) { 25 22 for( unsigned long i = 0; i < N; i++ ) { … … 28 25 } 29 26 30 extern "C" {31 static worker_t * workers;32 }33 34 27 int main(int argc, char * argv[] ) { 35 28 processor p; 36 29 { 37 30 worker_t w[7]; 38 workers = w;39 31 } 40 32 } -
src/tests/preempt_longrun/processor.c
r174845e rbeefc34c 2 2 #include <thread> 3 3 #include <time> 4 5 #include <unistd.h> 4 6 5 7 #ifndef PREEMPTION_RATE … … 11 13 } 12 14 13 static const unsigned long N = 5 _000ul;15 static const unsigned long N = 50_000ul; 14 16 15 17 int main(int argc, char* argv[]) { 16 18 processor * p[15]; 19 write(STDOUT_FILENO, "Preparing\n", sizeof("Preparing\n")); 17 20 for ( int pi = 0; pi < 15; pi++ ) { 18 21 p[pi] = new(); 19 22 } 23 write(STDOUT_FILENO, "Starting\n", sizeof("Starting\n")); 20 24 for ( int i = 0; i < N; i++) { 21 25 int pi = i % 15; … … 23 27 p[pi] = new(); 24 28 } 29 write(STDOUT_FILENO, "Stopping\n", sizeof("Stopping\n")); 25 30 for ( int pi = 0; pi < 15; pi++ ) { 26 31 delete( p[pi] ); 27 32 } 33 write(STDOUT_FILENO, "Done\n", sizeof("Done\n")); 28 34 }
Note: See TracChangeset
for help on using the changeset viewer.