scndcorp
Available
Work
École 42 ParisStudent, École 42 project

Philosophers: threads, mutex and concurrency in C

École 42 project, solving the dining philosophers problem in C: threads and mutex, managing concurrency and shared access, preventing starvation and precise timing control.

École 42 Paris

Challenge

Tackling concurrent programming through the classic dining philosophers problem: getting several threads that share resources (the forks) to coexist without deadlock or starvation, with precise timing.

Impact

  • Solving the dining philosophers problem with multithreading
  • Synchronization through mutex and prevention of deadlock/starvation
  • Precise timing control and death detection

What was done

A solution built with pthread: one thread per philosopher, mutex to protect the forks and the shared states, a life loop (eat / sleep / think) and precise time monitoring to detect death and avoid starvation.

Stack

The technologies used on this mission.

  • C
  • pthread (threads)
  • Mutex
  • Concurrence / synchronisation

A similar project in mind?

Let's talk through your challenges and see how to turn your vision into maintainable, tested technical reality.