- fixed a really dumb issue with the eat time start waiting in eat - it waited for 100 times the intended amount, causing issues. a thousandth second isnt quite a tenth second
- fixed fork access data race in eat. f u, copilot!
- fixed problems with case ./philo 5 800 200 200 7, where the start stagger function would calculate a value higher than the death time. intead of fixing that specifically though, I mae ft_sleep take in the last eat time and conceptually not sleep past a philos death, but return. now nowhere in the program, anyone can forgot to die becaue theyre busy, great!
- made the fork mutexes protect a list of booleans, not be the forks themselves
- moved death.c to philo_loop folder, makes more sense
- stopped errors from not logging with VERBOSE (renamed it back, too. it also changed the changelog, which may or may not be pretty confusing)
- reworked atoi.c, ft_isspace is unnecessary, and added a check for if theres anything at all that isnt a number. if so, throw error
- valgrind
- fixed death flag mutex not being cleaned up in cleanup function
- helgrind also fine, lets go
- i broke the death flag thing - now everybody dies without checking the others. FIXED! quick push, should have checked that before pushing the last commit
- moved all shared resources from philo inputs to inputs, that was the death flag & its mutex
- removed detailed logging functionality
- removed print_philo_input_data, its unused
- renamed VERBOSE to VERBOSE, its clearer and doesnt do anything else anyways
- i thought that then i set VERBOSE to 0 and nothing logged.
- norminettification, again, thats done now
- fixed logic flow issue preventing the program to start in input validation when log_error wasnt on
- currently we segfault but ill fix that later
- death flag mutex with getters and setters so philos dont die after each other
- dedicated die method which executes both death flag getter and setter for data race safety
- added emojis to philo logging, togglable with emoji macro in header
- all tests still passed
- fixed logic issue in previous norminettification
- clearer input error messages
- freed everything that was dynamically allocated anywhere, destroyed all the mutexes
- norminettification
- create log_detailed_philo_action function, more compact
- complete restructuring of determine_first_philo_to_eat, still works
- restructuring of philo_loop, moved logic inside of while loop to execute_philo_action
- general refactorings
- fixed sleep using milliseconds and microseconds inconsistently.
- added determine_first_philo_to_eat function, which ensures the first and last philo dont go on each others nerves.
- created expected eat time system
- in think, this eat time gets calculated.
- in eat, we wont start eating until roughly that time.
- also, the philos get staggered differently at the start depending on how many there are in total
- mini fixes
- made philo loop log is thinking for the threads that dont start by eating, makes more sense
- made thread with only one philo not wait 200 ms at start
- added check for whether any other philo has died to the eating check
- added step system to philo loop, now death and eat time are checked after every action
- fixed philos using the end of their eating period as the last eat time - it should be the start
- implemented fork switching mechanic - now every uneven philo takes the right, every even philo the left fork first. like this, deadlock chances are decreased
- fixed single philosopher spamming sleeping and thinking endlessly because he cant eat
- added a detailed messages macro and made it print more stuff (putting forks down)
- fixed eat action not checking whether dead after locking a mutex, which could theoretically take quite some time.
- Added printing mutex to ensure we dont print things inside of each other
- made makefile put objs in their own directory
- moved some stuff around in the structs
- added solid cleanup function
- better forks mutex array handling
- multiple completely inconsequential changes
- some of them even went so far as to change the code in any way whatsoever
- added some helpful comments where necessary
- removed submodules, they should both be unnecessary. libft isnt allowed and ft_printf is unnecessary now that weve got normal printf
- its been a while.
- created an include folder, added colors.h for ansi color codes (had to change all header file references) & replaces previous color printouts
- added readme
- moved all imports to header for clarity & a better overview
- for some reason, there was a compilation issue - easy to fix, but makes me anxious, i dont remember how i left this code
- before having philo fall asleep, program now checks whether he will starve during sleep. if so, only wait usleep that long and accurately time the death message
- define shared flag "death" that every thread checks to signal if another thread died and program should end
- proper wraparound for forks of last philo, previously, it would access a non-existent fork
- added nice function for philo state logging with colors
- norminette improvements, code cleanup
- renamed struct property number_of_times_each_philosopher_must_eat to something less lengthy
- added timing.c, which gets milliseconds since Jan 1, 1970
- added eating mutex functionality
- created philo loop, currently with dysfunctional exit
- created setup function that inits mutexes and starts philo threads
- created simple thread function that currently just prints some thread input data
- moved printing function into own file & general cleanup
- Added epic table visualization
- Added makefile, header, subject, folder structure
- created logger & atoi utils
- created an input manager that populates the new t_inputs struct
- created tester.sh to check whether everything works