How to Use Python to Run an App in a New Process: Best Practices?

18 Replies, 1788 Views

Hey! For Python run app in new process, I’d say go with `multiprocessing` if you want it to run independently without blocking the main script. It’s pretty straightforward and handles a lot of the heavy lifting for you.

If you’re worried about zombie processes, make sure to use `Process.join()` or `Process.terminate()` to clean things up. Also, check out the `concurrent.futures` module—it’s a bit more modern and might fit your needs better.

For memory leaks, just keep an eye on resource usage with tools like `psutil`. Hope that helps!

Messages In This Thread



Users browsing this thread: 1 Guest(s)