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

percentile output for intermediate results reporting mode added #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

denis-plotnikov
Copy link
Contributor

No description provided.

}

static void reg_tmp_percentile_val(double val)
{
Copy link
Contributor

Choose a reason for hiding this comment

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

With such an implementation of lock_tmp_percentile()/unlock_tmp_percentile() you still have a race condition here.

E.g.: is_locked_tmp_percentile() returns 0, and then before reg_percentile_val() is called another threads locks it.
If you want to do it atomically, you need to use CAS instruction (__sync_val_compare_and_swap() gcc intrinsic).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants