Skip to content

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Dec 14, 2020

Fixed:

  • Properly set the flag before calling releaseSync
  • TSBPD: check the flag immediately after re-locking m_RecvLock

Note: the sanity check to make the wait on tsbpd_cc interrupted once per a time (125ms) that had to prevent the deadlock was removed, as it has significantly burdened the CPU usage of the TsbPd thread.

@maxsharabayko maxsharabayko added this to the v1.4.3 milestone Dec 22, 2020
@maxsharabayko maxsharabayko added [core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior labels Dec 22, 2020
@maxsharabayko maxsharabayko modified the milestones: v1.4.3, v1.4.4 Apr 13, 2021
@maxsharabayko maxsharabayko modified the milestones: v1.4.4, Backlog Aug 17, 2021
srtcore/core.cpp Outdated
@@ -5550,7 +5561,7 @@ void * srt::CUDT::tsbpd(void* param)
if (self->m_bClosing)
break;

SRT_ATR_UNUSED bool bWokeUpOnSignal = true;
bool bWokeUpOnSignal = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The scope of this variable can be reduced. It is used both in the if and else statements, but independently. Thus can be defined inside those.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are right, this was likely tied to some earlier version that provided some log instruction after this if-branch, hence the scope was bigger. Now it has its own log in every branch, so this isn't necessary.

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.

Project coverage is 68.63%. Comparing base (5f16494) to head (83fcba8).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
srtcore/core.cpp 66.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1709      +/-   ##
==========================================
+ Coverage   65.75%   68.63%   +2.87%     
==========================================
  Files         101      101              
  Lines       17966    18327     +361     
==========================================
+ Hits        11814    12579     +765     
+ Misses       6152     5748     -404     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maxsharabayko
Copy link
Collaborator

Tested on a Raspberry Pi3 alike platform.
Hard to tell for sure from a single run, but might be a small performance degradation of the TSBPD thread.

This PR
image

SRT v1.5.4 master 2024-12-12 f109fb1
image

@maxsharabayko
Copy link
Collaborator

Second run.

This PR.
image

Master 2024-12-12 f109fb1
image

@maxsharabayko
Copy link
Collaborator

Third run

This PR.
image

Master 2024-12-12 f109fb1
image

@ethouris
Copy link
Collaborator Author

ethouris commented Jan 6, 2025

Would you be able to check also a similar version, just in place where there's a wait on tsbpd_cc just replace the timely waiting with forever waiting, while assigning true to the boolean variable?

Hard to believe that this is the point of performance degradation, but there are about 3 candidates among the changes that could cause it. I also hope that you made the measurements on C++11 version.

@ethouris ethouris removed this from the Backlog milestone Mar 3, 2025
@ethouris ethouris added this to the v1.5.5 milestone Mar 3, 2025
@cl-ment cl-ment merged commit f3a8fe3 into Haivision:master Mar 12, 2025
12 checks passed
This was referenced Mar 13, 2025
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: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants