Conversation
Ashod
commented
Apr 17, 2026
- wsd: manage Admin singleton explicitly
- wsd: use deadline-based poll in Admin
- wsd: use chrono in Admin
- wsd: minor Admin cleanup
a8fde6e to
efcfe6f
Compare
| /// Takes the deadline, instead of a timeout. | ||
| /// Note: will *not* return until the deadline expires, or upon | ||
| /// hitting an error. Always polls at least once. Returns last rc. | ||
| int poll(std::chrono::steady_clock::time_point deadline) |
There was a problem hiding this comment.
This is a change to common Socket poll bundled along with every thing else. I can imagine its perfectly fine for Admin, but is it ok for everything else?
I mean was it that before this wakeup() would cause a poll to end, and now it doesn't and other users may depend on the original behaviour? Or am I just confused by the three different things called poll() and only Admin uses this variant?
There was a problem hiding this comment.
This is the first and only use of the deadline-based poll() overload. The original poll() (called from this one) still behaves as normal. This overload was implemented but unused.
We can't blindly replace the regular one with this overload. Agreed.
caolanm
left a comment
There was a problem hiding this comment.
Fine by me then, there is some conflicts in the meantime. Maybe we should rename one of the "poll" to be "pollUntilDeadline" or something like that
With a function-local static instance there are all sorts of life-time management issues. The explicit approach resolves them, or at least gives us controls to resolve them. Change-Id: I66c2ec276b1594f20ddb159d9e00bbbfdaae43d4 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Change-Id: I438dd99ca189f8edcd19538414447b74ba5e8010 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The admin needs to check the time for a number of things to do/update, which are not cheap. Since the Admin already knows when the soonest it'll need to take action next, there is no point in executing the time checks on every poll when we know the answer (it's not time until the already calculated time). Now we ask poll to only get back to us when the pre-calculated deadline has reached. So spurious wakes wouldn't cost any extra cycles. Change-Id: I78774d40c0cc962b08a7aaeef929945eb34a1b36 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Change-Id: I8e12c43b6a648a6cbcaa9b0650272ca3727e9add Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
efcfe6f to
2370ffc
Compare