JyNI中的垃圾回收-如何桥接标记/扫描和引用计数GC
Garbage Collection in JyNI - How to bridge Mark/Sweep and Reference Counting GC
摘要:
Jython是一个基于Java的Python实现,是集成Python和Java的最无缝的方式。它通过将Python代码编译为Java字节码并让Java的JIT对其进行优化来实现高效率-这种方法使Python代码能够调用Java函数或子类化Java类。它使Python代码能够利用Java的多线程特性,并利用Java内置的垃圾回收(GC)。但是,它目前不支持CPython的C-API,因此不支持NumPy和SciPy等原生扩展。由于大多数科学代码都依赖于这样的扩展,所以它不能在Jython中运行。Jython Native Interface(JyNI)是一个兼容层,旨在在Jython之上提供CPython的原生C扩展API。JyNI是使用Java本机接口(JNI)实现的,它的本机部分被设计为与现有扩展构建二进制兼容。
英文摘要:
Jython is a Java-based Python implementation and the most seamless way to integrate Python and Java. It achieves high efficiency by compiling Python code to Java bytecode and thus letting Java's JIT optimize it - an approach that enables Python code to call Java functions or to subclass Java classes. It enables Python code to leverage Java's multithreading features and utilizes Java's built-in garbage collection (GC). However, it currently does not support CPython's C-API and thus does not support native extensions like NumPy and SciPy. Since most scientific code depends on such extensions, it is not runnable with Jython. Jython Native Interface (JyNI) is a compatibility layer that aims to provide CPython's native C extension API on top of Jython. JyNI is implemented using the Java Native Interface (JNI) and its native part is designed to be binary compatible with existing extension builds [...].
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。