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 Dec 13, 2024
1 parent f00c066 commit 427c1a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ When the synchronization is set up correctly, the following rules ensure the sur
Philosophers can be grouped into two synchronized sets (even and odd positions). All philosophers survive if:
- `t_eat < t_die / 2`, and
- `t_die > (t_eat + t_sleep)`
A small buffer (e.g., 10 ms) should be added to `t_die to` account for potential system delays. Examples:
A small buffer (e.g., 10 ms) should be added to `t_die` to account for potential system delays. Examples:
- `./philo 4 610 300 300` → All philosophers survive.
- `./philo 4 610 310 290`→ At least one philosopher starves.

- **Odd number** of philosophers:
Philosophers are divided into three groups (two synchronized sets and one unsynchronized philosopher). All philosophers survive if:
- `t_eat < t_die / 3`, and
- `(t_die / 2) > (t_eat + t_sleep)`
Again, adding a small buffer (e.g., 10 ms) to t_die is recommended. Examples:
Again, adding a small buffer (e.g., 10 ms) to `t_die` is recommended. Examples:
- `./philo 3 610 200 100` → All philosophers survive.
- `./philo 3 610 210 90`→ At least one philosopher starves.

Expand Down

0 comments on commit 427c1a6

Please sign in to comment.