Microsoft Interview Question
Software Engineer / DevelopersMultiProcessing has its advantages too -
1> Diff processes are insulated from each other by the OS , so an error in one process won't affect another , in contrast to threading model where error in one thread will pull down all threads.
2> virtual address space is Process specific and hence all data on heap can be accessed by all threads which has its own ill effects.
3>Multiple processes can run with different permissions thus ensuring protection.
*Multi-threading is most beneficial in the context of large applications,where a collection of cooperating programs are each to be executed by a seperate thread.
- Sravani Duggirala October 01, 2008*Another important benefit of multi-threading is when using a multiprocessor system ,where it is possible to exploit parallelism using threads.
Process switching is generally more expensive than thread context switching and creating and destroying threads is much cheaper than process creation and destruction.