[XML-SIG] Advice on how to deal with locking problems using python-wrapped C libs in MT frameworks like Zope/Twisted?

Craeg K Strong cstrong@arielpartners.com
Fri, 21 Mar 2003 14:24:57 -0500


Hello:

I am attempting to plug in Python bindings for C/C++ based XML 
frameworks like Sablotron,
libxslt, and Xalan/C into Zope.    I am noticing lockup/timeout behavior 
whenever the integration
framework calls back out to Zope.  For example, consider the following 
XSLT transformer:

<?xml version="1.0"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:include href="../simple.xsl"/>
</xsl:stylesheet>

In this case, libxslt is calling back out to Zope to resolve the 
relative url "../simple.xsl"
and that is when the lockup occurs.

I don't have these problems with 4Suite, perhaps because it is pure Python?

My guess is that the Python wrappers might be using the Global 
Interpreter Lock
in such a way that Zope gets locked out trying to access the file resource?

My question: has anyone else had to deal with such issues?  Do you
think something like using asyncore or just creating a worker thread
for the Python wrapper might make a difference?  

I am planning on trying these strategies out, myself, I just wanted to
see if there was some other poor soul out there who has
already dealt with such issues.

Thanks very much,

--Craeg