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

Vsync proposal #4133

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

Vsync proposal #4133

wants to merge 3 commits into from

Conversation

scance
Copy link
Contributor

@scance scance commented Jul 8, 2024

This proposes an API to abstract pthread synchronization devices (mutex & conditions) as part of libvarnish making it usable outside of varnishd while offering the ability to leverage varnishd VSC instrumentation.

This abstracts pthread_mutex_t and pthread_cond_t entirely and lives
in libvarnish making it usable outside of varnishd.
Instrumentation is abstracted and is externally supplied.
This also exposes the ability to use the monotonic clock to wait on
conditions, macOS <= 14.4 appear to not have the POSIX API allowing
this, a transparent portability trade-off is proposed for this case.
Comment on lines +42 to +45
.. varnish_vsc:: wait_duration_ns
:type: counter
:level: debug
:oneliner: Amount of nanoseconds spent waiting of condition variables.
Copy link
Contributor

Choose a reason for hiding this comment

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

fyi, an attempt at this was rejected last time around: #3977
Not sure if adding this to non-core locks is OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This amount of time is an amount of time spent waiting on a condition, it is not related to locks per se. I would therefore argue that it is not the same. Isn't the change you mention measures the amount of time in a critical section ?

Copy link
Contributor

Choose a reason for hiding this comment

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

It was both, time spent waiting for the lock or condvar.
As I said, it could be OK outside of the core. I just mentioned it as it was closely related.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

alright 👍

@scance
Copy link
Contributor Author

scance commented Jul 8, 2024

The test failure seems to come from a flaky test (I am not reproducing the issue nor do I see how it could relate to this PR).

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