NachOS/code/test/threadcreate.c
Yorick Barbanneau 6e0d91918a TD2 II.3 add for in threadcreate
We've got problem since thread stack are the same
2021-11-19 14:15:57 +01:00

24 lines
496 B
C

#ifdef CHANGED
#include "syscall.h"
void f(int c) {
/* Since our stack is shared with other threads, we've got
* a problem here, when executing a thread there is not 8 iterations.
* This is like synchronisation */
volatile int i;
for (i=0;i<8;i++){
PutChar((char)c);
}
ThreadExit();
}
int main(){
int i = 64;
for (i=64; i < 68; i++){
ThreadCreate(f, i);
}
// PutString("end of main()\n");
ThreadExit();
//return 0;
}
#endif