TD2 II.3-4 Manage UserStack with Bitmap

Add a Semaphore to manage threads waiting list
This commit is contained in:
Yorick Barbanneau 2021-11-18 23:12:42 +01:00
parent 6e0d91918a
commit 4da093ca38
4 changed files with 67 additions and 11 deletions

View file

@ -6,15 +6,15 @@ void f(int c) {
* 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++){
for (i=0;i<16;i++){
PutChar((char)c);
}
ThreadExit();
}
int main(){
int i = 64;
for (i=64; i < 68; i++){
int i;
for (i=65; i < 91; i++){
ThreadCreate(f, i);
}
// PutString("end of main()\n");