[pve-devel] [RFC PATCH widget-toolkit] utils: API2Request: defer masking after layout

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Mar 19 09:21:31 CET 2024


On 19/03/2024 08:44, Dominik Csapak wrote:
> thinking about it a bit more though, i think what would be better here
> is a ref counting of running api2 requests on that waitMsgTarget
> and only unmask when the count reaches zero... I'll send a v2 for that

fine by me, both have some coupling in how the component is doing
loading and could theoretically break and possibly have a tiny
chance that they result in flickering when having the UI open on
a localhost and the first load finishes before the second one
started.

In anyway, this would be still a improvement over the current
situation, so fine by me.


On 19/03/2024 08:44, Dominik Csapak wrote:
> On 3/18/24 16:50, Thomas Lamprecht wrote:
>> On 18/03/2024 14:44, Dominik Csapak wrote:
>>> the masking if this marker is still there. (thankfully javascript is
>>> single threaded so this should not end up being a data race)
>>
>> Note that async could cause data races also in single-threaded
>> code, but as we do not use that here and no yield point exist
>> that doesn't matter here – just mentioning it because the statement
>> would suggest that one could not have code that is susceptible to
>> such a race at all in JavaScript, which is not true.
> 
> true, but those can only happen (as you mentioned) at yield points (await)
> and since most of our code is non-async i did not mention it here, but
> yeah one additional sentence about it being non async is probably warranted

yeah, as said, just your blanket statement is wrong in the general
sense, so I'd either drop it or adapt it to "as we're in
synchronous JS code there can be no data-race" would be less
contentious




More information about the pve-devel mailing list