Thread safety of Matlab engine API

前端 未结 4 701
名媛妹妹
名媛妹妹 2020-12-06 02:43

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

4条回答
  •  旧巷少年郎
    2020-12-06 03:25

    When I first started using the engine, I didn't run across any documentation on thread safety, so I assumed that it was not thread-safe.

    I use a C++ class to synchronize access to an engine instance. For more parallel processing designs, I instantiate multiple instances of the engine class.

    (edit) I'm using MATLAB R14 on Solaris. I open the engine using the 'engOpen' call, and close it using 'engClose'. My platform does not crash when the Close is called by a different thread than the one that called Open.

提交回复
热议问题