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

18 Replies, 1794 Views

Hey! For Python run app in new process, I’d say `multiprocessing` is the best bet. It’s designed for this kind of thing and works well across platforms.

If you’re worried about memory leaks, try using `resource` module to monitor usage. And for clean exits, just make sure to catch exceptions and call `Process.terminate()` if needed.

Also, check out this library called `joblib`—it’s great for parallel tasks and handles a lot of the boilerplate for you. Hope that helps!

Messages In This Thread



Users browsing this thread: 1 Guest(s)