https://github.com/zainabdnaya/philosepher_42
The Dining_Philosepher_probleme: In this repository u will see the basics of threading a process and how to work on the same memory space
https://github.com/zainabdnaya/philosepher_42
c dining-philosophers dining-philosophers-problem mutex pthread semaphores
Last synced: 4 months ago
JSON representation
The Dining_Philosepher_probleme: In this repository u will see the basics of threading a process and how to work on the same memory space
- Host: GitHub
- URL: https://github.com/zainabdnaya/philosepher_42
- Owner: zainabdnaya
- Created: 2021-04-24T00:42:27.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-09T11:35:37.000Z (over 4 years ago)
- Last Synced: 2025-04-12T06:49:51.551Z (8 months ago)
- Topics: c, dining-philosophers, dining-philosophers-problem, mutex, pthread, semaphores
- Language: C
- Homepage:
- Size: 1.48 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Philosepher_42 :tada:
In this repository u will see he basics of threading a process and how to work on the same memory space
# What is MultiThreads? 🧵
Multithreading is a specialized form of multitasking
and a multitasking is the feature that allows your computer
to run two or more programs concurrently.

# What Are Threads? :clipboard:
A thread is a small sequence of programmed instructions.
Threads refer to the highest level of code your processor can execute.
# What The point of mutex ? :dart:
the point of a mutex is to synchronize two threads.
When you have two threads attempting to access a single resource, the general pattern is to have the first block of code attempting access to set the mutex before entering the code.
When the second code block attempts access, it sees that the mutex is set and waits until the first block of code is complete (and unsets the mutex),
then continues.
# What is semaphores
Semaphore is simply a variable that is non-negative and shared between threads.
This variable is used to solve the critical section problem and to achieve process synchronization in the multiprocessing environment.