source: src/tests/preempt_longrun/processor.c@ 91cfa34

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum with_gc
Last change on this file since 91cfa34 was b9da9585, checked in by Thierry Delisle <tdelisle@…>, 7 years ago

Fixed long run tests

  • Property mode set to 100644
File size: 437 bytes
RevLine 
[cc3e4d0]1#include <kernel>
2#include <thread>
[b9da9585]3#include <time>
[cd99ef1]4
[cc3e4d0]5#ifndef PREEMPTION_RATE
[b9da9585]6#error PREEMPTION_RATE not defined in makefile
[cc3e4d0]7#endif
8
[8ad6533]9Duration default_preemption() {
[cc3e4d0]10 return PREEMPTION_RATE;
11}
12
[b9da9585]13static const unsigned long N = 5_000ul;
14
[cc3e4d0]15int main(int argc, char* argv[]) {
[e5d4e5c]16 processor * p[15];
17 for ( int pi = 0; pi < 15; pi++ ) {
18 p[pi] = new();
19 }
20 for ( int i = 0; i < N; i++) {
21 int pi = i % 15;
22 delete( p[pi] );
23 p[pi] = new();
[cc3e4d0]24 }
[1449d83]25}
Note: See TracBrowser for help on using the repository browser.