Bug 161168 - WebDav UCP - has (fairly) busy-loop in a thread refreshing locks
Summary: WebDav UCP - has (fairly) busy-loop in a thread refreshing locks
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2024-05-18 20:47 UTC by Michael Meeks
Modified: 2024-05-19 03:15 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2024-05-18 20:47:07 UTC
It appears that:

ucb/source/ucp/webdav-curl/SerfLockStore.cxx

Hasa  thread that wakes up 25 times per second:

        std::this_thread::sleep_for( std::chrono::milliseconds(1000/25) );

to see if some timeouts have expired.

However - the method 'refreshLocks' could easily tell us how long it will be until we need to refresh another lock; and if we wait/sleep on a condition we can signal that if new ones are added.

This would make scheduling far more relaxed.

Suggest adding a shortest deadline in milliseconds to wake up again as a return value from 'refreshLocks()' there and sleeping that long.

=)
Comment 1 Michael Meeks 2024-05-18 20:48:14 UTC
Hi Michael; not sure if you're interested in this one =) but was a curio I stumbled over in some code reading there.