Advertisement
novaking148

alon_hw11

Jan 17th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. זאת הייתה הגשה טיפה מבולבלת אלון, הייתי שמח אם היית מתייעץ איתי יותר במהלך העשייה.. שים לב להערות ואני מציע שתנסה לעשות את התרגיל עוד פעם בשביל להבין באמת את השימוש במנעולים
  2.  
  3. -The threads you start are doing nothing because the function you pass them is empty.
  4. - The code for eating should have been inside the thread. The way you did it means every philosopher eats one after the other in a circular way. and beats the purpose of using locks.
  5. - At last, when you initialized the criticalsection, you initialized only the first one,
  6. You have an array of criticalsections - which means you need to initialize every cell in the array.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement