[reportlab-users] Re: thread safe ?
Jeff Kowalczyk
reportlab-users@reportlab.com
Mon, 29 Jul 2002 09:16:35 -0400
> (7) do not use the same TrueType font for different documents at the
> same time
> That's an artifact of dynamic subsetting code in ttfonts.TTFont, and I
> think I could fix it without much difficulty if there's a need. The
> font object would have to maintain different subsets indexed by
> id(canvas).
Actually, that may be a limitation Zope users could run into. My typical
Zope use case for reportlab will be to build dynamic forms and reports on
demand, in response to web form requests. I'm building things emulating Jeff
Bauer's HCFA form sample in Zope 'Product' modules, with web form input for
the text. They would likely have at least some TTF fonts and other
formatting shared between reports, although I've been developing with only
basic fonts up to now.
Since I'm on the subject, this type of Zope usage should be clear of most of
the global shared state issues that limit thread-safety, right? I'm not
really adjusting any global settings, and most of my reports will be simple
lines and text written to canvas of fixed layout and discrete pages. As soon
as the PDF is complete, I write it to the Zope Database or the HTTP
response. Multiple requests to the Zope python product will certainly
overlap under load, but the canvases will never be shared. Should be OK?