[reportlab-users] Removal of global paraparser

Robin Becker robin at reportlab.com
Mon Mar 18 08:02:49 EDT 2013


On 17/03/2013 18:46, Andy Robinson wrote:

> I have just committed a very small change which gets rid of the global

> paragraph parser, and instantiates it for each Paragraph.

>


the 'correct' way to do this would be to make the parser part of a thread locals
variable. That way it would be instantiated once by each thread and not by each
paragraph.

It's never been exactly clear why we pay a penalty for importing threading etc
etc, but I assume that's why we never created these variables that way.



> We had a real-world case of threading problems which were probably

> down to this.

.....

I suspect that all the other threading issues will now surface eg all the module
level stuff in pdfbase/pdfmetrics.py.

In addition none of our accelerators has any real notion of multi-threaded
politeness. Hopefully that's enforced by python itself.
--
Robin Becker


More information about the reportlab-users mailing list