I would just advise you not to do this.
Do not implement material in C / C ++ "for speed". An effective advantage is not , which can be as big as you expect; for example, compared to implementing in Java using the “best practice” design and specifications.
Do not try to glue many languages together. You set yourself up for a lot of portability problems, debugging difficulties, and reliability issues; for example due to C / C ++ errors, JVM failed. In addition, there is an overhead of performance at the crossroads between languages, and there may be unexpected bottlenecks. (For example, you may find that your C / C ++ should start single-threaded due to threading issues, and therefore you cannot take advantage of Java multithreading in a typically multi-core system.)
Instead, I advise you to look for libraries that will allow you to implement the entire application in one language. If this is not possible, design it so that different language components are different executable files / processes, exchanging messages via RPC, messaging, etc.
source share