I would like to get some advice on how to integrate Julia into an existing application written in C++. I mainly work in image processing and computer vision applications.
May traditional way of working is to do the exploratory prototyping in a high-level language, and then, when algorithms stabilize, rewrite them in C++ (using a lot of OpenCV, Eigen, etc.). Then the algorithms would be easily integrated into the main C++ application. One of the main aspects that attracted me to Julia was the possibility of conduction exploratory research in a language and then evolve to a final high-performance code without having to rewrite in another language. Thus solving what I may call the "standard" two-languages problem. But now, after starting to develop algorithms in Julia, I'm facing an unexpected problem. I really need to have my applications written in C++: heavy use of OpenGL, CUDA, real-time, multi-thread, low-level stuff, etc.; besides the application having a well-established source code base. The problem arises when I tried to embed Julia into these C++ applications. For example, in a certain application, I would like to run a small fast piece of Julia code in a "quasi-real-time" fashion within one thread, and at the same time, in another thread, run a heavy Julia algorithm in a sporadic fashion. This has shown to be impossible due to Julia threading limitations (which I understand that come from code generation, GC, and Julia dependency libraries). This is what I may call the other face of the two-languages problem. With the traditional approach, the rewriting can solve the two faces of the problem, improve performance and at the same enable a better integration into a library or an application. Now, let me ask two questions. - Will the current thread support development allow embedding Julia into multiple threads (even if it is as multiple instances)? - What are my options **today**, if any, to somehow overcome this limitation? Thanks.