Author stefan.richthofer
Recipients jeff.allen, stefan.richthofer, zyasoft
Date 2018-08-05.10:56:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Exactly because Jython has no GIL, PyFile_IncUseCount/PyFile_DecUseCount should surround every direct file access via fd pointer. Correct me if I'm wrong, but I think the JVM cannot detect and guard external file access by this pointer. That's why it is internal API.

I also considered to forward calls of PyFile_IncUseCount/PyFile_DecUseCount to file channel lock/release. However that's not correct, because that would also lock file access. Use count is only supposed to prevent concurrent closing and there seems to be no way to achieve this directly in FileChannel.

Anyway. Implementing the monkeypatch seems to be easier than convincing you. Also regarding the perspective that we might have to get rid of FileIO.__int__. For now I will just observe actual use of PyFile_IncUseCount/PyFile_DecUseCount by a dummy implementation emitting warnings.

Agreed that --add-exports should not be a requirement in Jython. I still think we even depend on --illegal-access which is even worse I guess. We can move this critical stuff to JyNI if it comes to that.
Date User Action Args
2018-08-05 10:56:04stefan.richthofersetmessageid: <>
2018-08-05 10:56:04stefan.richthofersetrecipients: + stefan.richthofer, zyasoft, jeff.allen
2018-08-05 10:56:04stefan.richthoferlinkissue2699 messages
2018-08-05 10:56:03stefan.richthofercreate