Skip to content

WIP - a classic multithread program to learn how to avoid data race and deadlock issues

License

Notifications You must be signed in to change notification settings

biralavor/42_philosophers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42_philosophers

A classic multithread program to learn how to avoid data racing and dead lock issues

philosopherse

My take-aways about Philosophers project are:

How to run:

Here is a few pre-setup possibilities. Note that all of them are adding the args_to_test variable as an argument to run ./philo

  • make go :: Let's Go mode
    • For checking how the threads are running, without changes.
  • make gdb :: GNU DeBugger mode
    • For debugging propuses, with a lot of pre-setup executables, like run, breakpoint at main, and set args.
  • make val :: Valgrind mode
    • For checking memory leaks, this will calls valgridn with a lot of options.
  • make hel :: Helgrind mode
    • For checking Threads errors, this will calls valgrind with the helgrind tool activated.
  • make drd :: Data Race Detector - DRD mode
    • For checking Data Race errors from Threads, this will calls valgrind with the drd tool activated.
  • make sani_t :: Fsanitize for Threads mode
    • For checking various forms of undefined or suspicious behaviors, switching to threads mode.
  • make sani_a :: Fsanitize for Address mode
    • For checking various forms of undefined or suspicious behaviors, switching to address mode.

image