Hello Professor,
I have read the discussions about how to stop the clients which finished their jobs. There are three methods:
1. while(1){ yield(); sleep(1); } // cause the system to be slower
2. while(1){ yield(); } // use 100% of CPU
3. P(&block_sem); // block on a semaphore which is initialized to 0.
After trying all of them, I think the third one is the best. It blocks all the finished clients and cause the program to exit eventually when there are no clients running.
I saw your comments on the prior two approaches, but didn't see that about the third one. So, how do you think about it?