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

Alleviate lock contention in the load balancing mechanism #613

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jodavies
Copy link
Collaborator

Add a small sleep in LoadReadjusted to allow threads to aquire the lock. This enormously speeds up some simple tform tests under valgrind.

See also #600

This effectively just adds "a bit more waiting" to the already-existing /* Wait a bit.... */ comment.

@jodavies jodavies added this to the v4.3.2 milestone Jan 27, 2025
@coveralls
Copy link

coveralls commented Jan 27, 2025

Coverage Status

coverage: 50.712% (-0.03%) from 50.74%
when pulling 3948821 on jodavies:load-balancing
into 1d5e40b on vermaseren:master.

Copy link
Collaborator

@tueda tueda left a comment

Choose a reason for hiding this comment

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

This looks OK, but is 0.01s really necessary? Though it is a small amount, 10^7 clock cycles might be excessive.

@jodavies
Copy link
Collaborator Author

You are probably right. At least on my system sleeping for 1us is also enough to let valgrind run. Let's make it shorter.

Add a small sleep in LoadReadjusted to allow threads to aquire the lock.
This enormously speeds up some simple tform tests under valgrind.
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.

3 participants