Tutorials:
-
Threads: https://www.youtube.com/watch?v=d9s_d28yJq0&ab_channel=CodeVault
-
Race Conditions: https://www.youtube.com/watch?v=FY9livorrJI&ab_channel=CodeVault
-
Mutex: https://www.youtube.com/watch?v=oq29KUy29iQ&ab_channel=CodeVault
-
Create Threads in a Loop: https://www.youtube.com/watch?v=xoXzp4B8aQk&ab_channel=CodeVault
-
Return Value from Thread: https://www.youtube.com/watch?v=ln3el6PR__Q&list=PLfqABt5AS4FmuQf70psXrsMLEDQXNkLq2&index=7
Steps Necessary in Building the Program:
- Argument Checkers
- Initialize Arguments into Structs
- Create the Threads
- Set the Ground Rules for the "Game"
- Grab and Handle Time
- Create the Mutexes for Forks, Eating and Printing
- Destroy Mutexes, Free Allocated Memmory
Random:
- Add "-pthread" to tasks.json File to be able to Create and Join Threads, otherwise must use the -pthread Flag when Compiling (gcc -g -pthread file.c)
- gcc -S filename.c Compiles C Code into Assembly Code(.s file)