[pylucene-dev] simple threading segfault demo

Andi Vajda vajda at osafoundation.org
Mon Mar 19 10:01:42 PST 2007


On Mon, 12 Mar 2007, Ofer Nave wrote:

> Thanks, that worked!
>
> Unfortunately, due to Python threads being user-level threads, it seems my
> script doesn't see any performance gains from the second CPU (I/O isn't much
> of a bottleneck since I have enough spare RAM on the box to cache the entire
> filesystem).

Python threads are normally real OS threads. While the python interpreter is 
running, though, python holds a Global Interpreter Lock (GIL). Whenever 
PyLucene calls out of Python into the compiled Lucene code (looks like C++ to 
Python) the GIL is released for the full threading concurrency afforded by 
Java.

Andi..


More information about the pylucene-dev mailing list