- Each philosopher should be a thread.
- There is one fork between each pair of philosophers. Therefore, if there are several philosophers, each philosopher has a fork on their left side and a fork on their right side. If there is only one philosopher, there should be only one fork on the table.
- To prevent philosophers from duplicating forks, you should protect the forks state with a mutex for each of them
https://codecharms.me/posts/operating-system-the-dining-philosophers-problem https://pages.mtu.edu/~shene/NSF-3/e-Book/MUTEX/TM-example-philos-1.html#:~:text=To address this problem, we,chopsticks), and can eat.
https://man7.org/linux/man-pages/man7/pthreads.7.html
https://www.cs.cmu.edu/afs/cs/academic/class/15492-f07/www/pthreads.html
https://www.youtube.com/watch?v=HDohXvS6UIk
https://docs.oracle.com/cd/E19455-01/806-5257/sync-12/index.html
http://www.it.uc3m.es/pbasanta/asng/course_notes/helgrind_tool_en.html