Custom Thread Implementation in Java: Is It Possible Although JNI?

Is it possible to implement a safe / proper way to a custom Thread class in Java (using JNI)?

Suppose I write my own class NewThreadusing my own method start(), which run()returns execution, calls in a forked stream and returns ...

Is it possible? Will the JVM complain? Is it "legal" according to the specifications? Does it break something, for example, in a memory model? Does it depend on the specific JVM?

+3
source share
2 answers

Java Native Interface , 8.1.5.

, , . Java " " (Linux) , . " " , .

Sun JRE 1.3, , "" , , JNI , , .

+1

. ++ lib, . JNI pthreads, Java JNI. pthreads, Java-. , , - JNI. JNI , . , .

, JVM JIT , JNI, .

, . Java Threads, . , .

+1

Source: https://habr.com/ru/post/1759539/


All Articles