pyjnius icon indicating copy to clipboard operation
pyjnius copied to clipboard

Troubles using jnius in a multiprocess environment

Open audetto opened this issue 3 years ago • 4 comments
trafficstars

Hi,

In the office we have tried to use jnius in a multiprocess environment. This has been very problematic on linux where the whole thing hangs almost always.

In Windows it works.

It seems that if I set python's processes to spawn rather than fork, it works.

Java version does not seem to be relevant (1.8, 1.14, 1.17 all behave the same). Python 3.6 and 3.8 are affected.

Is this supported at all?

audetto avatar Oct 21 '22 17:10 audetto

Hi @audetto !

Do you have a reproducible example?

misl6 avatar Oct 21 '22 18:10 misl6

Will try, but so far I can only share a partial call stack

image

jnius has already been initialised in the main process, and the hang is in a forked process, not in the first call to autoclass, but probably the very first real java code executed.

audetto avatar Oct 23 '22 15:10 audetto

I would like to be able to use the jnius library in the renpy engine, for visual novels, and even install the files but I don't know where to put them, anywhere I try to put the non-regular renpy when importing

ramires9 avatar Jun 04 '24 12:06 ramires9