[pylucene-dev] PythonThread and searching

Andi Vajda vajda at osafoundation.org
Thu May 18 10:32:08 PDT 2006


On Thu, 18 May 2006, tsuraan at tsuraan.net wrote:

> I believe that python's global lock prevents execution of the interpreter 
> while any c-code is being executed.  Does this also apply to searches being 
> done in PythonThreads?  If I have multiple long-running searches, will they 
> block each other due to the way the python interpreter is designed, does 
> PyLucene get around this somehow, or am I totally wrong in my concern?

Whenever PyLucene calls into C++/Java, it releases the GIL and whenever the 
call returns or whenever PyLucene calls back into Python it re-acquires the 
GIL.

Your concern would have been right in the very early days of PyLucene where it 
wasn't doing this. To verify this, you can run the ThreadIndexFiles.py sample.

Andi..

>
> _______________________________________________
> pylucene-dev mailing list
> pylucene-dev at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/pylucene-dev
>


More information about the pylucene-dev mailing list