Skip to content

Conversation

@denis-plotnikov
Copy link
Contributor

No description provided.

httpress.c Outdated
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