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

[core] Use busy wait only to refine below 1 ms. #936

Merged
merged 2 commits into from Nov 5, 2019

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented Nov 4, 2019

Use high accuracy busy waiting to wait only the remaining 1 ms (10 ms on Windows) of the waiting time.
Reduces idle CPU from around 20% to almost zero on Windows machines at low bitrates.

The solution is taken from #673, proposed by @oviano.

Use high accuracy busy waiting to wait only the remaining 1 ms (10 ms on Windows) of the waiting time.
Reduces idle CPU from around 20% to almost zero on Windows machines at low bitrates.
@maxsharabayko maxsharabayko added Type: Maintenance Work required to maintain or clean up the code [core] Area: Changes in SRT library core labels Nov 4, 2019
@maxsharabayko maxsharabayko added this to the v1.4.1 milestone Nov 4, 2019
@maxsharabayko maxsharabayko added this to Needs review in Development via automation Nov 4, 2019
from m_ullSchedTime. And names of some other variables as well.
Development automation moved this from Needs review to Reviewer approved Nov 4, 2019
#endif

timeval now;
gettimeofday(&now, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use monotonic clock when ENABLE_MONOTONIC_CLOCK is defined.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for self-reference, PR #929 reworks this code

@rndi rndi merged commit 2b34c21 into Haivision:master Nov 5, 2019
Development automation moved this from Reviewer approved to Done Nov 5, 2019
@maxsharabayko maxsharabayko deleted the develop/busy-wait-limit branch November 5, 2019 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code
Projects
No open projects
Development
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants