help with threads

Michael Mossey michaelmossey at gmail.com
Sun Aug 9 00:43:32 EDT 2009


On Aug 7, 5:03 pm, Piet van Oostrum <p... at cs.uu.nl> wrote:
> >>>>> Michael Mossey <michaelmos... at gmail.com> (MM) wrote:
> >MM> Ah yes, that explains it. Some of these long computations are done in
> >MM> pure C, so I'm sure the GIL is not being released.
>
> Is that C code under your own control? Or at least the glue from Python
> to C? In that case, and if the C code is not manipulating Python objects
> or something in the Python interpreter, it could be changed to release
> the GIL during the computation. That's also how Numpy does it, IIRC.
> --
> Piet van Oostrum <p... at cs.uu.nl>
> URL:http://pietvanoostrum.com[PGP 8DAE142BE17999C4]
> Private email: p... at vanoostrum.org

I don't have any control over this code, and it's easier to solve my
problem in other ways. I just put a sleep() call between calls to the
C library, and that gives the network thread enough responsiveness for
my particular task. I am grateful, anyway, to understand why this kind
of thing happens.



More information about the Python-list mailing list