Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

想了解一下Java通过JNI调用c++&c代码的效率问题。网上说使用JNI,在c和Java之间转换存在性能损失,但是Java中,涉及底层的,比如wait()等native方法,不也是使用JNI的吗?

网上更是看到这种描述:

clipboard.png
socket的read()和write不也是通过JNI调用的吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
199 views
Welcome To Ask or Share your Answers For Others

1 Answer

并不是,JVM调用一些基础库的时候使用libffi进行,不需要JNI


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...