Last active
December 17, 2015 04:09
-
-
Save mreiferson/5548391 to your computer and use it in GitHub Desktop.
is_starved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_starved(conns): | |
for c in conns: | |
# the constant 0.85 is designed to *anticipate* starvation rather than wait for it | |
if c.in_flight > 0 and c.in_flight >= (c.last_ready * 0.85): | |
return True | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment