I’m running a multiprocessing application with Python, and have a hard time cleaning up the resource after the program finishes. My program has many interaction with C library, and I need to make sure resources in the C library are released properly.
Therefore, I would like to know the setup and cleanup process of Python interpreter:
- From OS created the process, until Python interpreter starts to run bytecode, what happens in between?
- When a program exits, or being interrupted by signals, what is the cleanup order of objects in Python?
I searched the python documentation page, and find little resource on this.