Re:Improving Firefox Responsiveness on macOS
by whoisthemachine on Monday October 10, 2022 @03:52PM
(#33155714)
Just curious, when developing a cross-platform application such as FF, would it make sense to implement an efficient lock within the FF codebase rather than relying on undocumented OS functions?
[ Parent
| on HN ]
Re:Improving Firefox Responsiveness on macOS
by joeldo on Monday October 10, 2022 @04:24PM
(#33156010)
My understanding is that an efficient lock would require hardware support, which is surfaced by the OS.
Re:Improving Firefox Responsiveness on macOS
by gsvelto on Monday October 10, 2022 @05:44PM
(#33156739)
No specific hardware support is needed to implement a lock. The atomic operations are all accessible from user-space - they are platform dependent though. The problem with locks is that they interact with scheduling and that's where the kernel comes in, that's why you need an OS-specific component too.
Re:Improving Firefox Responsiveness on macOS
by joeldo on Monday October 10, 2022 @07:54PM
(#33157791)
That makes sense, thanks.
Re:Improving Firefox Responsiveness on macOS
by gsvelto on Monday October 10, 2022 @05:43PM
(#33156722)
In a word: no. Efficient locks can only be implemented with significant involvement from the kernel. The best locks that can be implemented entirely in user-space will still suffer from the problems described in the article. Locks have complex interactions with scheduling and the only place where informed decisions can be made about them is within the kernel.
That doesn't mean that good locks don't need a good user-space component - they do - but it's only one side of the coin.
Re:Improving Firefox Responsiveness on macOS
by whoisthemachine on Wednesday October 12, 2022 @03:39PM
(#33181976)
Thanks, that completely makes sense, I hadn't thought of the scheduler's involvement.