[pylucene-dev] PyLucene in CherryPy

Andi Vajda vajda at osafoundation.org
Wed Jun 28 02:21:21 PDT 2006


On Tue, 27 Jun 2006, joe kim wrote:

> I am trying to use PyLucene in CherryPy or more specifically
> TurboGears.  Unfortunately, I am getting a segmentation fault.
>
> A quick search of the archive shows that other have had this problem,
> but I have not seen a successful solution.  Has anyone had any luck
> getting PyLucene to run in CherryPy?
>
> Is the only known working solution for using PyLucene in a web
> application mod_python?

To use PyLucene in a web app you must ensure that the thread calling into 
PyLucene is an instance of PyLucene.PythonThread. This makes sure the thread 
is created via libgcj and that the libgcj garbage collector is made aware of 
it. Currently, there is no way to register a thread with the libgcj garbage 
collector after it has been created. This is a long standing limitation of the 
garbage collector...

I don't know CherryPy or mod_python but there's got to be a way to customize 
the thread pools used to create the 'right' kind of thread instance.

If someone comes up with a solution it'd be great to post it here as this is a 
rather frequently asked question.

Andi..


More information about the pylucene-dev mailing list