11. Difference Between Single-Threaded and Multi-Threaded Processes
What is the difference between single-threaded and multi-threaded processes in Linux? Discuss the advantages of using multiple threads within a process compared to using multiple processes.
In single threaded process, all resources are being utilized by one thread only whereas in multithreaded process, all resources are being shared between them. In a multithreaded system,the main thread creates the new threads. The primary advantage of multi threaded process is that when the process has a lot to do, threads can run simultaneously on multiple processors, potentially speeding up the computation. Though we can use multiple processes also, but threads are lightweight and it is easier for threads to communicate via shared memory, whereas the process needs to communicate over a channel like a network or a pipe.