Skip to content
/ philo Public

Apply the basics of threading a process. Creating threads and discover mutexes.

Notifications You must be signed in to change notification settings

Gab-182/philo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Philosophers

Apply the basics of threading a process. Creating threads and discover mutexes.

The specific rules for the mandatory part are:

  1. Each philosopher should be a thread.
  2. 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.
  3. To prevent philosophers from duplicating forks, you should protect the forks state with a mutex for each of them

GitHub code size in bytes Code language count GitHub top language GitHub last commit

Resources

General:

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.


Threads:

https://man7.org/linux/man-pages/man7/pthreads.7.html

https://riptutorial.com/c/example/2622/data-race#:~:text=The execution of a program,race results in undefined behavior.

https://www.cs.cmu.edu/afs/cs/academic/class/15492-f07/www/pthreads.html

https://www.youtube.com/watch?v=HDohXvS6UIk

https://www.youtube.com/watch?v=d9s_d28yJq0

https://www.youtube.com/watch?v=xoXzp4B8aQk


Mutexes:

https://docs.oracle.com/cd/E19455-01/806-5257/sync-12/index.html

https://www.delftstack.com/howto/c/mutex-in-c/

https://www.youtube.com/watch?v=oq29KUy29iQ


Helgrined and Data races

http://www.it.uc3m.es/pbasanta/asng/course_notes/helgrind_tool_en.html

https://valgrind.org/docs/manual/hg-manual.html

https://riptutorial.com/c/example/2622/data-race#:~:text=The execution of a program,race results in undefined behavior.

About

Apply the basics of threading a process. Creating threads and discover mutexes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published