Our programming model is like this:
The c code is to capture the real-time events(very frequent) of the system and java code runs as a server to receive the request. When there is an event captured by the c code, we need to send request to java code and wait for the reply. I have tried JNI to call java from c, but it seems that it will stuck after running for several seconds. JNI needs to initialize jvm and search the handler in the class file. Is there any better way to communicate between c and java? Can I compile java code into binary and link it with the c code? Thanks