[pylucene-dev] attachCurrentThread from a different thread?

Andi Vajda vajda at osafoundation.org
Wed Nov 14 12:10:32 PST 2007


On Wed, 14 Nov 2007, Andi Vajda wrote:

>
> On Wed, 14 Nov 2007, Bill Janssen wrote:
>
>> Is it possible to "attach" a thread to the Java VM from another Python 
>> thread?
>
> That's the purpose of attachCurrentThread(). You create a thread in python, 
> then you want to call into the VM from that thread. That thread has to call 
> attachCurrentThread() first. This never worked in the old PyLucene but works 
> well in the new one.

If you meant to ask if there was another API to attach _another_ thread 
to the VM from a given thread, the answer seems to be 'no'.

The JNI API attachCurrentThread() is the one API for this and it's meant to 
attach the currently running thread to the VM.

Andi..



More information about the pylucene-dev mailing list