Yeah, it's been my experience that PyLucene and threads just don't
work.

Thread do work, but they must be instances of the PyLucene.PythonThread class otherwise libgcj's garbage collector doesn't know about them and the process crashes really fast.

There's this old problem with native code libraries and threads
causing seg faults... I don't know if there's any way around it.

The real way around it would be for the libgcj garbage collector to be able to be told about threads after they are created. This is currently not supported and Hans Boehm, the author of the garbage collector, intends to support it 'eventually'.

Andi..


2005/7/26, Rune Hansen <[EMAIL PROTECTED]>:
Hi,
I'm trying to move a PyLucene searcher that works when implemented in
mod_python to Cherrypy(svn498). Unfortunately all I've managed to get
so far is a Segmentation fault. The main difference is that
mod_python forks and Cherrypy uses threads, I guess that's what's
causing the Segfault. I've so far been completely unable to sneak in
a PyLucene.PythonThread anywhere in the code and make it work.

Anyway, the Segfault seems to happen when a Cherrypy request thread
tries to create a FSDirectory.getDirectory(..

import os
os.environ['GCJ_PROPERTIES'] ="disableLuceneLocks=true"
import cherrypy
from PyLucene import *
class LuceneSeach(object):
     def __init__(self,...
         .
     @cherrypy.expose
     def index(self,..
         .
     @cherrypy.expose
     def search(self,indexpath,...
         directory = PyLucene.FSDirectory.getDirectory(indexpath,False)
         .
if __name__ == "__main__":
     cherrypy.root = LuceneSearch()
     cherrypy.config.update(..
     cherrypy.server.start()

I'd appreciate any help or suggestions.

best regards
/rune

Happy those, who can remain at Highbury!
Jane Austen


_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to