threads_vs_processes
This is an old revision of the document!
Threads v.s. Processes
Problems with multiprocessing v.s. multithreading:
Threads all share the same starting code. Consider adding in initialization logic for all threads, v.s. all processes. With processes, every entry point into the program needed to be updated, which can be cumbersome. Recently I tried adding some signal handlers to a program that aid in debugging. Having lot's of processes (like cron's) made it annoying to track them all down. Additionally, with multiprocessing, it may not be possible to set this up, as you may not be in control of main() everywhere. In my case, rq python spawned the Python VM and invoked my function, preventing any change of setting up the handlers first.
threads_vs_processes.1743462593.txt.gz · Last modified: by carl
