-
Notifications
You must be signed in to change notification settings - Fork 376
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
base: master
Are you sure you want to change the base?
Vsync proposal #4133
Conversation
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.
.. varnish_vsc:: wait_duration_ns | ||
:type: counter | ||
:level: debug | ||
:oneliner: Amount of nanoseconds spent waiting of condition variables. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright 👍
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). |
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.