SOLVED: Multiprocessing python module not working

Hello @sensormusik

I stand corrected. The statement you linked is misleading, apologies.

Back when this was tested, the test setup was actually weak and wrongfully made me think that everything was working as expected. The process was actually silently dying during execution.

  1. Your problem of hang is easy to explain and understand, the recv method is blocking. To prevent this method from being blocking, you should call the poll() method on the connection object.

  2. However, even then, the method you pass to your Pipe will fail in the subprocess. This is part of TouchDesigner and exist only in this instance of TouchDesigner. This is caused by the current architecture of TouchDesigner where the TouchDesigner process itself is the python interpreter, but where most of the python representation of the TouchDesigner objects, including extension and DATs as module, is generated at runtime.

  3. There is currently no way that I know of to run the multiprocess library in TouchDesigner. Instead, you could rely on the Threading library which will create threads and stay in the TouchDesigner context, or design a standalone Python app / process that you would start in parallel to TouchDesigner, using a .bat or .sh file.

I hope this covers most of it,

Best,
Michel