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

Martin v. Löwis martin@v.loewis.de
21 Mar 2003 23:17:20 +0100


Craeg K Strong <cstrong@arielpartners.com> writes:

> I am noticing lockup/timeout behavior whenever the integration
> framework calls back out to Zope.

It is crucial to determine whether they are lockup (won't terminate on
its own) or timeout (will terminate after some time) problems.

> 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?

If it is a timeout, this likely is not the cause - you would get a
deadlock with that, and a deadlock would stay indefinitely.

> My question: has anyone else had to deal with such issues?  

Most certainly. Usually, a slowdown is caused by somebody trying to
resolve URLs, contacting remote systems in the process.

> Do you think something like using asyncore or just creating a worker
> thread for the Python wrapper might make a difference?

Uncertain. You should try to understand the problem first.

Regards,
Martin