Changeset cd99ef1
- Timestamp:
- Jul 19, 2017, 12:33:20 PM (8 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, resolv-new, with_gc
- Children:
- 8b28a52
- Parents:
- 3175147
- Location:
- src/tests
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/preempt_longrun/create.c
r3175147 rcd99ef1 1 1 #include <kernel> 2 2 #include <thread> 3 4 static const unsigned long N = 2_000ul; 3 5 4 6 #ifndef PREEMPTION_RATE … … 16 18 int main(int argc, char* argv[]) { 17 19 processor p; 18 for(int i = 0; i < 10_000ul; i++) {20 for(int i = 0; i < N; i++) { 19 21 worker_t w[7]; 20 22 } -
src/tests/preempt_longrun/enter.c
r3175147 rcd99ef1 3 3 #include <thread> 4 4 5 #undef N6 5 static const unsigned long N = 70_000ul; 7 6 -
src/tests/preempt_longrun/enter3.c
r3175147 rcd99ef1 3 3 #include <thread> 4 4 5 #undef N6 5 static const unsigned long N = 50_000ul; 7 6 -
src/tests/preempt_longrun/processor.c
r3175147 rcd99ef1 1 1 #include <kernel> 2 2 #include <thread> 3 4 static const unsigned long N = 5_000ul; 3 5 4 6 #ifndef PREEMPTION_RATE … … 15 17 16 18 int main(int argc, char* argv[]) { 17 for(int i = 0; i < 10_000ul; i++) {19 for(int i = 0; i < N; i++) { 18 20 processor p; 19 21 } -
src/tests/preempt_longrun/yield.c
r3175147 rcd99ef1 1 1 #include <kernel> 2 2 #include <thread> 3 4 static const unsigned long N = 325_000ul; 3 5 4 6 #ifndef PREEMPTION_RATE … … 13 15 14 16 void main(worker_t * this) { 15 for(int i = 0; i < 325_000ul; i++) {17 for(int i = 0; i < N; i++) { 16 18 yield(); 17 19 } -
src/tests/sched-int-barge.c
r3175147 rcd99ef1 5 5 #include <thread> 6 6 7 #ifndef N 8 #define N 100_000 7 static const unsigned long N = 50_000ul; 8 9 #ifndef PREEMPTION_RATE 10 #define PREEMPTION_RATE 10_000ul 9 11 #endif 10 12 13 unsigned int default_preemption() { 14 return 0; 15 } 11 16 enum state_t { WAIT, SIGNAL, BARGE }; 12 17 … … 14 19 15 20 monitor global_data_t { 16 bool done;21 volatile bool done; 17 22 int counter; 18 23 state_t state; … … 55 60 c->do_wait2 = ((unsigned)rand48()) % (c->do_signal); 56 61 57 //if(c->do_wait1 == c->do_wait2) sout | "Same" | endl;62 if(c->do_wait1 == c->do_wait2) sout | "Same" | endl; 58 63 } 59 64 … … 93 98 } 94 99 100 static thread_desc * volatile the_threads; 101 95 102 int main(int argc, char* argv[]) { 96 rand48seed(0); 97 processor p; 98 { 99 Threads t[17]; 100 } 103 rand48seed(0); 104 processor p; 105 { 106 Threads t[17]; 107 the_threads = (thread_desc*)t; 108 } 101 109 } -
src/tests/sched-int-block.c
r3175147 rcd99ef1 5 5 #include <thread> 6 6 7 #ifndef N 8 #define N 10_000 7 #include <time.h> 8 9 static const unsigned long N = 5_000ul; 10 11 #ifndef PREEMPTION_RATE 12 #define PREEMPTION_RATE 10_000ul 9 13 #endif 14 15 unsigned int default_preemption() { 16 return PREEMPTION_RATE; 17 } 10 18 11 19 enum state_t { WAITED, SIGNAL, BARGE }; … … 101 109 102 110 int main(int argc, char* argv[]) { 103 rand48seed( 0);111 rand48seed( time( NULL ) ); 104 112 done = false; 105 113 processor p; -
src/tests/sched-int-disjoint.c
r3175147 rcd99ef1 4 4 #include <thread> 5 5 6 #ifndef N 7 #define N 10_000 6 static const unsigned long N = 10_000ul; 7 8 #ifndef PREEMPTION_RATE 9 #define PREEMPTION_RATE 10_000ul 8 10 #endif 11 12 unsigned int default_preemption() { 13 return PREEMPTION_RATE; 14 } 9 15 10 16 enum state_t { WAIT, SIGNAL, BARGE }; -
src/tests/sched-int-wait.c
r3175147 rcd99ef1 5 5 #include <thread> 6 6 7 #ifndef N 8 #define N 10_000 7 static const unsigned long N = 10_000ul; 8 9 #ifndef PREEMPTION_RATE 10 #define PREEMPTION_RATE 10_000ul 9 11 #endif 12 13 unsigned int default_preemption() { 14 return PREEMPTION_RATE; 15 } 10 16 11 17 monitor global_t {}; … … 114 120 int main(int argc, char* argv[]) { 115 121 waiter_left = 4; 116 processor p ;122 processor p[2]; 117 123 sout | "Starting" | endl; 118 124 {
Note: See TracChangeset
for help on using the changeset viewer.