Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use NET_Sleep() (or Sys_Sleep in SP) to avoid busy-waiting #695

Merged
merged 3 commits into from
Mar 20, 2016

Commits on Mar 13, 2016

  1. Remove some unused files

    These are not mentioned in any of the CMakefiles, so they can't be
    compiled by any supported configuration.
    smcv committed Mar 13, 2016
    Configuration menu
    Copy the full SHA
    b219bb2 View commit details
    Browse the repository at this point in the history
  2. Use NET_Sleep() (or Sys_Sleep() in SP) to avoid busy-waiting

    Backported and simplified from an assortment of ioquake3 commits,
    mostly by Thilo Schulz, with contributions from Zack Middleton and
    Özkan Sezer.
    
    The single-player engines don't have any netcode, and in particular
    no NET_Sleep(); if they had a straightforward port of NET_Sleep(),
    it would be roughly equivalent to Sys_Sleep() anyway, since they
    don't have anything to receive from the network. As a result, I've
    used Sys_Sleep() instead of NET_Sleep() there.
    
    This makes the hard-coded 5ms Sys_Sleep() calls in main()
    (and the 50ms equivalents in a couple of unused Windows equivalents)
    unnecessary, so I've made them conditional on this logic being
    disabled (com_busyWait 1).
    
    The practical effect of those 5ms Sys_Sleep() calls in terms of
    framerate-limiting varied according to the framerate your computer
    would be capable of without the limit, and because of the way this
    framerate limit works, it's best if the limit is an integer divisor of
    1000. I've arbitrarily chosen com_maxfpsMinimized to be 50fps, which is
    what would have happened on a PC capable of slightly less than 60fps
    in the old implementation.
    
    Fixes JACoders#507.
    
    Signed-off-by: Simon McVittie <smcv@debian.org>
    smcv committed Mar 13, 2016
    Configuration menu
    Copy the full SHA
    7b1256b View commit details
    Browse the repository at this point in the history
  3. stdin_active: remove, unused

    This was only used in the old NET_Sleep() implementation, which I've
    just removed.
    
    Signed-off-by: Simon McVittie <smcv@debian.org>
    smcv committed Mar 13, 2016
    Configuration menu
    Copy the full SHA
    fe0ba40 View commit details
    Browse the repository at this point in the history