[Poppler-bugs] [Bug 50992] library should be thread-safe

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Aug 23 05:35:03 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=50992

--- Comment #39 from Adam Reichold <adamreichold at myopera.com> 2012-08-23 12:35:03 UTC ---
(In reply to comment #38)
> How should we continue now (and should we continue or leave it as a study
> only)?

Speaking as a user of the library:

> 1. The just uploaded patch is complete and regtested for page rendering with
> splash. What is with other devices? I could implement it for cairo (if the
> cairo library is thread safe itself and does i.e. not use static variables) and
> test if with a testcase for pdftocairo, but I'm not sure about other devices,
> and i.e. in my opinion it makes no sense to have a thread safe page rendering
> in PSOutputDev.

I'd say that this is most important for the output devices that are generically
used in interactive applications, so I don't see to much use of it in
PSOutputDev either.

> 2. We still have the open question if we copy the xref all the time and do not
> use doc->getXRef() anymore. I think it's not too expensive to copy it all the
> time and would implement it if all agree. I hadn't done that until now because
> it was easier to compare differences.

I'd say that the overhead is warranted if this improved thread safety can be
expanded upon later. Currently, it seems like concurrent execution in all its
forms will only become more important. (I would also consider cleaner code a
benefit that can be weighted against performance, but I am speaking as a user.)

> 3. I think that a PDFDoc instance is what should be able to share in different
> threads, so I offer to have a additional look into the PDFDoc implementation
> which methods are changing private members and lock these methods, but I have
> no idea how to test such changes.
> 
> Any comments are welcome, even if the main opinion would be to leave this as a
> study. It was more work than I thought, but until now I did it because of
> theoretical interests.

I would be very interested in this for practical reasons because with
complicated documents, this increases the perceived performance of interactive
applications very much. (Especially when combined with some form of
prefetching.) Even if this introduces some overhead in the single-threaded
case, the latency of an interface would go down and overall rendering speed
would improve (at least on regular desktop systems).

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list