Skip to content

Commit

Permalink
Prevent blocking of processes at last starvation level (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
plbrault authored Oct 22, 2023
1 parent 486ad69 commit c253f8e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/game_objects/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ def update(self, current_time, events):
self._starvation_level = 0
event_manager.event_process_starvation(self._pid, self._starvation_level)
if (
not self._is_on_io_cooldown
not self.starvation_level == LAST_ALIVE_STARVATION_LEVEL
and not self._is_on_io_cooldown
and randint(1, 100) <= self._io_probability_numerator
):
self._wait_for_io()
Expand Down

0 comments on commit c253f8e

Please sign in to comment.