Making Paragraph::latex() thread safe?
Kornel Benko
kornel at lyx.org
Tue Aug 30 11:20:08 UTC 2022
Am Tue, 30 Aug 2022 12:02:24 +0200
schrieb Pavel Sanda <sanda at lyx.org>:
> On Mon, Aug 29, 2022 at 03:52:19PM -0400, Scott Kostyshak wrote:
> > I think the speedup will be even faster if we could make Paragraph::latex()
> > thread-safe.
>
> Before tuning threads - are you sure that the sequential run can be broken in this way,
> i.e. whether subsequent paragraphs are not dependent on some information produced
> before (like some counters, etc)?
>
>
>
> > If I protect it with a mutex, then things work much better. But that's exactly the
> > code that I need to run in parallel for my knitr child documents to export in
> > parallel. Could someone explain intuitively why this code is not thread-safe? Is
> > there any hope of making it thread-safe without major surgery?
>
> The bottlenecks I typically experience are of two kinds:
> 1) pictures conversion (having parallel code would be great even for document load when
> ton of pics gets converted!) 2) final pdflatex compilation
>
> The latex generation part is just neligible.
The latex part may help in find algorithm though, where is is often called.
> Point 1 seems to be a good candidate for paralelization. External calls (like knitr)
> might be as well in case, again, its evaluation can't be dependent on the previous
> insets. But in this case I am almost sure some previous knitr inset might produce
> something needed for the subsequent ones ...
>
> Pavel
Kornel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220830/be75a1a4/attachment.asc>
More information about the lyx-devel
mailing list