Advertisement
novaking148

yehonatan_hw11

Jan 17th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. הגשה יפה יהונתן, בהחלט יש מקום להבנה יותר עמוקה ובדיוק רשמת לי בוואטסאפ שאתה עושה את זה אז, כל הכבוד :) הנה כמה הערות לתת לך כיוון:
  2. - An array for the critical sections and philosophers indexes is way more suited for this.
  3. - Will give you the option of using loops here, something very appropriate for this.
  4. - We need to close every Handle we use. In this case Thread Handle, something you are missing.
  5. - You leave the critical section only when the loop ends. Which means you lock everything inside the loop and it will never end because a deadlock situation will be realized. You should have checked for every tryenter which succeeds you need to release the lock afterwards.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement