TD2 II.3-4 Manage UserStack with Bitmap
Add a Semaphore to manage threads waiting list
This commit is contained in:
parent
6e0d91918a
commit
4da093ca38
4 changed files with 67 additions and 11 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue