Good morning,

I am exploring the idea of embedding Julia in our C++ medical image 
reconstruction streaming framework. Each piece of a given reconstruction 
workflow is basically a C++ class. Groups of classes live in dynamic 
libraries that are loaded at runtime (making them essentially plugins).

Anyway, we currently have a group of classes that provide an interface to 
an embedded Python runtime, allowing users to write reconstruction code in 
Python rather than C++. The main problem with embedding a Python 
interpreter and running code that calls NumPy is that we have to manually 
handle a lock for classes calling Python due to the GIL. I'd like to 
replace this functionality with an interface to Julia.

Two questions:

   1. Is it safe to allow code in multiple threads access the Julia runtime 
   using the C-API?
   2. If so, how would I distinguish between functions of the same name 
   contained in different files using the C-API? For example, 
   *NoiseAdjust.jl* and *Filter.jl* both define a "process" function which 
   modifies a multi-dimensional array. When the streaming framework loads, I 
   can open, read, eval both files. At this point, do I ensure the files have 
   different module declarations and look them up at runtime? I need to 
   somehow grab distinct pointers to each "process" function.
   
Notes:

   - The julia files are installed in a location unrelated to the Julia 
   installation.
   - The "process" functions from each file/module can be called many times 
   and simultaneously in various threads.

Thanks a lot for your help... The C-API is looking great!

-Joe

Reply via email to