source:
longrun_tests/processor.cfa
@
50e04cc
Last change on this file since 50e04cc was e8fe5e0, checked in by , 6 years ago | |
---|---|
|
|
File size: 580 bytes |
Rev | Line | |
---|---|---|
[73abe95] | 1 | #include <kernel.hfa> |
2 | #include <thread.hfa> | |
3 | #include <time.hfa> | |
[cd99ef1] | 4 | |
[ea8b2f7] | 5 | #include <unistd.h> |
6 | ||
[dc8511c] | 7 | #include "long_tests.hfa" |
[7bdcac1] | 8 | |
[cc3e4d0] | 9 | #ifndef PREEMPTION_RATE |
[b9da9585] | 10 | #error PREEMPTION_RATE not defined in makefile |
[cc3e4d0] | 11 | #endif |
12 | ||
[8ad6533] | 13 | Duration default_preemption() { |
[cc3e4d0] | 14 | return PREEMPTION_RATE; |
15 | } | |
16 | ||
[85b1deb] | 17 | static const unsigned long N = 50_000ul; |
[b9da9585] | 18 | |
[cc3e4d0] | 19 | int main(int argc, char* argv[]) { |
[e5d4e5c] | 20 | processor * p[15]; |
21 | for ( int pi = 0; pi < 15; pi++ ) { | |
22 | p[pi] = new(); | |
23 | } | |
[7bdcac1] | 24 | for ( int i = 0; TEST(i < N); i++) { |
[e5d4e5c] | 25 | int pi = i % 15; |
26 | delete( p[pi] ); | |
27 | p[pi] = new(); | |
[7bdcac1] | 28 | KICK_WATCHDOG; |
[cc3e4d0] | 29 | } |
[863c413] | 30 | for ( int pi = 0; pi < 15; pi++ ) { |
31 | delete( p[pi] ); | |
32 | } | |
[1449d83] | 33 | } |
Note: See TracBrowser
for help on using the repository browser.