[Zope] Time-consuming External method blocks Zope execution
Dieter Maurer
dieter@handshake.de
Thu, 14 Jun 2001 21:45:18 +0200 (CEST)
Etienne Labuschagne writes:
> I have an external Python method that can take a long time to complete.
> This method does some conversions of files on the Zope server into another
> format on request of a client. My problem is that the whole Zope
> installation comes to a standstill while this method executes.
This should not happen!
Is your conversion pure Python?
Then, there would be something wrong with Python's thread support.
It is supposed to switch threads every <x> instructions,
where "<x>" can be controlled by the "-i" option to
Zope's "z2.py".
If it is done in an external C module, then this module
may not have been designed (or compiler) for thread support.
If it does not release Python's interpreter lock, then
the other Python threads will not get a chance to run
before this module function returns.
Doing the conversion in its own thread would not help you
in either case.
While it is possible to let operations be executed in
a separate threads, it is not easy to do this in a
safe way (see other message titled "Zope transactions and
connections").
Dieter