Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alx-sch authored Oct 13, 2024
1 parent 273db4f commit 065762d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<img src="https://github.com/alx-sch/42_philosophers/blob/main/.assets/philosophers_badge.png" alt="philosophers_badge.png" />
</p>

## Fancy Printing

Add some flair to the philosopher's dinner by enabling additional visualization and simulation details.
Compile with `make FANCY=1` to activate this feature.



## Comparing `usleep` with a Custom Wait Function
I have implemented a custom wait function to address common issues with `usleep`, such as inconsistent delays. To illustrate the performance differences, I have included a test script: `test_usleep.c`.

Expand All @@ -15,7 +22,7 @@ cc test_usleep.c -lm -o test_usleep
./test_usleep
```

<img src="https://github.com/alx-sch/42_philosophers/blob/main/.assets/usleep_test_run.png" alt="usleep_test_run.png" width="400" />
<img src="https://github.com/alx-sch/42_philosophers/blob/main/.assets/usleep_test_run.png" alt="usleep_test_run.png" width="350" />

### Why a Custom Wait Function?
In real-time simulations, precise timing is crucial, as even small inaccuracies can lead to undesired behavior, especially when multiple threads interact and delays accumulate. The standard `usleep()` function may introduce unexpected delays because of how the operating system handles process scheduling, resulting in less precise timing.
Expand Down

0 comments on commit 065762d

Please sign in to comment.