I have discovered through trial and error that the MATLAB engine function is not completely thread safe.
Does anyone know the rules?
Discovered through trial
From the documentation,
MATLAB libraries are not thread-safe. If you create multithreaded applications, make sure only one thread accesses the engine application.