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
You can use engOpenSingleUse instead of using engOpen to make more than one thread working separately. (Only Windows)
engOpenSingleUse
engOpen