-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
see the following example, first with threads:
import matlab.engine
from concurrent.futures import ThreadPoolExecutor
def matlab_func(i):
eng = matlab.engine.start_matlab()
return eng.sqrt(i)
with ThreadPoolExecutor() as executor:
future = executor.submit(matlab_func, 4.0)
print(future.result())
vs the same with Processes:
import matlab.engine
from concurrent.futures import ProcessPoolExecutor
def matlab_func(i):
eng = matlab.engine.start_matlab()
return eng.sqrt(i)
with ProcessPoolExecutor() as executor:
future = executor.submit(matlab_func, 4.0)
print(future.result())
I find that the thread example works, but the process example runs forever.
This is with matlabengine version 24.2.2, MATLAB R2024b Update 3 on Linux.
Metadata
Metadata
Assignees
Labels
No labels