On 12/11/20 3:34 PM, Pavel Sanda wrote:
On Fri, Dec 11, 2020 at 04:29:13PM +0200, Yuriy Skalko wrote:
The only issue left is concerning tracker_/trackable_ members of
Trackable class used in call to track_foreign. As I understand it is
some hack to have lifetime of slots be the same as of containing class
(PreviewLoader::Impl/Converter::Impl). Is it right?
I've resolved this issue. Looking at the comment for Trackable class in
signals.h, I've implemented more thread-safe solution that tracks parents
directly with a shared_ptr as recommended by signals2. Now deletion of the
parent by a concurrent thread is prevented.

Trackable class is still used in Server.h/.cpp so I haven't deleted it.
Probably it should be moved there from signals.h.

Please check the attached patch.
By the way, when you are already digging into the internal workings of
preview loader, would it be hard to allow mutliple threads loading
graphics images in backgrounds instead of single one?
Documents with lot of figures take a long time to load fully and most
of nowadays machines have multiples cores, to do that job in parallel.

That's a great idea. If we were able to do this, then it would probably be a good idea to have a preference setting for how many simultaneous loads to attempt. We don't want to overwhelm the CPU.

Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to