I found that python multiprocessing is not starting from the Houdini UI but works from the hython. For example, this small code snippet:
frommultiprocessingimportProcessfromtimeimportsleepdeffoo():print("Processing is running")sleep(3)print("Done")t=Process(target=foo)t.start()print("Is Process alive: ",t.is_alive())t.join()
The same code works as expected (runs debug lines and process is alive) in the hython session but doesn't work in the Python Shell window from the running UI Houdini session.
Python threading works in both cases but in my circumstances, I'm using the multiprocessing approach, and at least would be nice to know why it doesn't work from the Houdini UI (H19.0.546).
I'm trying to do multi-processing to submit to deadline. My error when running your code says "Load failed for C:/Windows/System32/6344" And it launched a new houdini session said ('Is Process alive: ', True) after I closed out of the new houdini. From reading the docs, I think you need to execute it in __main__ not in session. and say if__name__ is '__main__': # Then make the process
Where __main__ has to be executed in the python shell unfortunately. If you figure out how to put hda code for example into __main__ that would be real helpful so I'll know how to do process checking before submitting to deadline