[reportlab-users] platypus.paragraph not thread safe

Robin Becker robin at reportlab.com
Mon Jun 12 03:30:27 EDT 2006

Gerhard Kalab wrote:
> I'm using reportlab within Zope 2 with the product RMLPageTemplate.
> If paragraph.py is used from more then one thread the state of the 
> global ParaParser is IMHO not guaranteed.
> Applies to reportlab 1.20, 1.21, 2.0.

Hi Gerhard, your observation that reportlab is not threadsafe is 
unfortunately only too true. We have module level variables in several 
places throughout the code and we have repeatedly stated that reportlab 

There are reasons to be cheerful though; in particular reportlab 
processing is usually cpu/memory intensive and the overhead of a cgi 
call is less than for smaller tasks. In old style (<2.0) versions we 
actually have code in the accelerator extensions that records font 
widths etc etc, that is my fault as the coder for the C stuff, but that 
problem should vanish in the latest code as it tries to use python data 
structures so the font registry should be resettable. However, it would 
take a lot of work to make ReportLab threadsafe. We have also 
recommended a single queue server approach, but that requires that we be 
able to completely reset reportlab to a known start state.

Sorry to be so negative.


Robin Becker

More information about the reportlab-users mailing list