From: Jeff A. <ja...@fa...> - 2020-01-10 08:25:11
|
Does anyone have thoughts about https://bugs.jython.org/issue2834? Investigating, I found that when each interpreter has its own class loader, but they ask for the same-named class, the action of our Java package cache is to give every interpreter the exactly same type object, wrapping the Java class object that the first interpreter loaded. So you will get yours through someone else's loader. This is a helpful issue as it has partially clarified something I have been uneasy about for some time (the relationship of interpreters, threads and packages). I see interesting parallels in recent discussion on python-dev, on thread state in relation to sub-interpreters (https://mail.python.org/archives/list/pyt...@py.../thread/PIXJAJPWKDGHSQD65VOO2B7FDLU2QLHH/). We have Java class loaders in the mix, but I think that might actually help us to a correct answer (in Jython 3). The cache ought to distinguish loaders (or interpreters), so classes different to the JVM are different types to Python. (Or can someone explain otherwise?) And it needs synchronisation. Correcting this, digging into JavaPackageManager and import is, in my view, risky enough to merit a third beta. I just wish I could be sure I've found what's behind issue 2834 as reported, not something else. We haven't had the OP's view. A mistaken analysis here could lead to a beta 4, and I'd really like to terminate this loop. Jeff -- Jeff Allen |