On Mon, Mar 22, 2021 at 7:49 AM Ben Rudiak-Gould
In the "Object Lifetime" section you say "registers should be cleared upon last reference". That isn't safe, since there can be hidden dependencies on side effects of __del__, e.g.:
process_objects = create_pipeline() output_process = process_objects[-1] return output_process.wait()
If the process class terminates the process in __del__ (PyQt5's QProcess does), then implicitly deleting process_objects after the second line will break the code.
Hang on hang on hang on. After the second line, there are two references to the last object, and one to everything else. (If create_pipeline returns two objects, one for each end of the pipe, then there are two references to the second one, and one to the first.) Even if you dispose of process_objects itself on the basis that it's not used any more (which I would disagree with, since it's very difficult to manage that well), it shouldn't terminate the process, because one of the objects is definitely still alive. This is nothing to do with a register-based VM and everything to do with standard Python semantics, so this can't change. ChrisA