NachOS/code/test/threadcreate.c
Yorick Barbanneau 4da093ca38 TD2 II.3-4 Manage UserStack with Bitmap
Add a Semaphore to manage threads waiting list
2021-11-19 14:15:58 +01:00

24 lines
492 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<16;i++){
PutChar((char)c);
}
ThreadExit();
}
int main(){
int i;
for (i=65; i < 91; i++){
ThreadCreate(f, i);
}
// PutString("end of main()\n");
ThreadExit();
//return 0;
}
#endif