I just discovered the new mex C++ API and immediately fell in love with it! But what's about thread safety of the matlab::engine::MATLABEngine::feval call in particular and the whole API in general? The docs don't say anything regarding this topic.
I have an algorithm that filters a lot of signals, which could gain a lot from parallelization. So ideally I'd like to create as much std::threads as there are independent signals and process them all in parallel with the MATLAB engine. Is that possible? I assume that the interpreter invoked by feval will be probably single-threaded, however maybe the execution of the function after parsing is capable of multithreading? Or should I go on and perform multithreaded filtering completely in the C++ domain using my own filter classes and go back to the MATLAB interface after having joined all threads?
What about the Data API? Is it safe to access (readonly) a matlab::data::Array from multiple threads in parallel?
I'm looking forwards to your answers!