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

18 Replies, 1787 Views

Yo, Python run app in new process is a classic problem. I’d go with `multiprocessing` unless you’re running something external.

To avoid zombies, just make sure to call `Process.join()` or `Process.terminate()` when you’re done. And yeah, `atexit` is overkill unless you’re doing something super complex.

Also, if you’re on Linux, check out `os.fork()`—it’s lightweight and fast for spawning processes. Just be careful with shared state. Cheers!

Messages In This Thread



Users browsing this thread: 1 Guest(s)