Threading a lengthy C function

Thomas Heller theller at python.net
Thu Nov 20 13:19:01 EST 2003


Skip Montanaro <skip at pobox.com> writes:

>     Thomas> I always wondered why (apparently) SWIG does not release the
>     Thomas> lock before calling into C code and acquire it back afterwards.
>
> Because it can't tell if the C code it's going to call will or won't make a
> call back to Python.  In most cases that would work, but in a few cases it
> could lead to nasty bugs.

Hm, which kind of bug could that be?  If the function doesn't call back
into python, everything's fine.  And if it does call back, it has to
acquire the lock again...

Thomas




More information about the Python-list mailing list