source: tests/preempt_longrun/processor.c @ 200fcb3

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resnenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprno_listpersistent-indexerpthread-emulationqualifiedEnum
Last change on this file since 200fcb3 was dc8511c, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

first attempt at updating suffixes for test programs

  • Property mode set to 100644
File size: 580 bytes
Line 
1#include <kernel.hfa>
2#include <thread.hfa>
3#include <time.hfa>
4
5#include <unistd.h>
6
7#include "long_tests.hfa"
8
9#ifndef PREEMPTION_RATE
10#error PREEMPTION_RATE not defined in makefile
11#endif
12
13Duration default_preemption() {
14        return PREEMPTION_RATE;
15}
16
17static const unsigned long N = 50_000ul;
18
19int main(int argc, char* argv[]) {
20        processor * p[15];
21        for ( int pi = 0; pi < 15; pi++ ) {
22                p[pi] = new();
23        }
24        for ( int i = 0; TEST(i < N); i++) {
25                int pi = i % 15;
26                delete( p[pi] );
27                p[pi] = new();
28                KICK_WATCHDOG;
29        }
30        for ( int pi = 0; pi < 15; pi++ ) {
31                delete( p[pi] );
32        }
33}
Note: See TracBrowser for help on using the repository browser.