to Process or not to Process?
Well, we all know the differences between processes and threads. Process has a little more of overhead than a thread, and threads have a common address space(well except for their stack), while processes have different address space.
but when I build an application why should it create different processes? why not having one process for each application and a lot of threads associated with it.
can you guru give me a real world example when it is appropriate to use more than one process in my application(whatever it would be..).
If threads have a little overhead over my app, it looks like I would prefer it over creating a lot of processes.
Thanks :D.
Re: to Process or not to Process?
One common practice is to give GUIs their own process, separate from the part of a program that actually does the hard work. This tends to enforce more modular coding styles.
Re: to Process or not to Process?
Sometimes it can be helpful to run plug-in engines in a separate process because of unexpected crashes caused by dodgy 3rd party dlls. If there is a crash you can shut down the plug-in process, but keep your main program alive.