[vlc-devel] [PATCH 00/13] Execute medialib queries out of the UI thread

Rémi Denis-Courmont remi at remlab.net
Tue Nov 24 16:23:55 CET 2020


Le lundi 23 novembre 2020, 22:28:54 EET Romain Vimont a écrit :
> IMO, this is never a good idea. Any I/O latency (for whatever reason)
> should never freeze the UI.

The eighties called and they want their real mode back. With demand paging, 
transparent swap and what-not, you cannot prevent I/O on the UI thread (or 
almost any thread really).

> I think that it is a common practice to never execute I/O from the UI
> thread.

And I am pretty damn sure that it is uncommon, or more accurately, never done 
except on low-end embedded devices.

> I think we should follow the same principle in the Qt interface.

I disagree. That's just vain as it won't achieve the goal anyway. And on a 
systematic basis, it would make the code insanely complex and buggy with 
events going back and forth - all for nothing.

> > And while the database might be robust enough to run from within VLC, it
> > is
> > abundantly that some part of indexing is *not*. I guess preparsing
> > especially.

> What would you suggest?

I already stated previously that intense I/O ops need to be done in a separate 
process. That's the only way to apply I/O scheduling policies to deprioritise 
them. With that said, I don't think the UI should even be doing intense I/O at 
all. Querying a few fields of a few objects in a database should not be an 
issue, or you really need to rethink the DB for better performance.

> Btw, even if indexing/preparsing is done from a separate process, it's
> still the same database with the same lock (so this would still cause
> delays).

No. Your design is pretty broken if the DB lock is held while preparsing.

-- 
Rémi Denis-Courmont




More information about the vlc-devel mailing list