The most obvious unit of parallilism, is a page or a set of pages. For example when rendering a book. It may
make sense to break it down into chapters which are separated by page breaks. Within the chapters
the text flow between pages requires them to be constructed in sequence.
The major shared resource between pages is fonts. Fonts need to be shared between pages and the
adapted encoding and glyph detection for subsetting needs to be thread-safe.
Fonts is likely to be be where much of the work is and there needs to be some locking somewhere. Either
(i) fine-grained locking in the font encoders or more coarse grained (ii) only allowing a font to be rendering once
on any given font.
(i) will impact both core fonts and PDF::Font::Loader, which will need to have locking support in all its
encoders (ii) is much simpler, but may result in bottlenecks if the rendering is text (rather than image)
intensive and a common font is being used across threads.
The most obvious unit of parallilism, is a page or a set of pages. For example when rendering a book. It may make sense to break it down into chapters which are separated by page breaks. Within the chapters the text flow between pages requires them to be constructed in sequence.
The major shared resource between pages is fonts. Fonts need to be shared between pages and the adapted encoding and glyph detection for subsetting needs to be thread-safe.
Fonts is likely to be be where much of the work is and there needs to be some locking somewhere. Either (i) fine-grained locking in the font encoders or more coarse grained (ii) only allowing a font to be rendering once on any given font.
(i) will impact both core fonts and PDF::Font::Loader, which will need to have locking support in all its encoders (ii) is much simpler, but may result in bottlenecks if the rendering is text (rather than image) intensive and a common font is being used across threads.