Explain any four benefits of using threads | Operating System Question & Answer

The benefits of using threads:  

 Responsiveness: Multi threading an interactive application may allow a program to continue running even if part of it is blocked or is performing a lengthy operation, thereby increasing responsiveness to the user. For instance, a multi threaded web browser could still allow user interaction in one thread while an image was being loaded in another thread.  

 Resource sharing: By default, threads share the memory and the resources of the process to which they belong. The benefit of sharing code and data is that it allows an application to have several different threads of activity within the same address space.  

 Economy:  Allocating memory and resources for process creation is costly. Because threads share resources of the process to which they belong, it is more economical to create and context-switch threads Empirically gauging the difference in overhead can be difficult, but in general it is much more time consuming to create and manage processes than threads. In Solaris, for example, creating a process is about thirty times slower than is creating a thread, and contexts witching is about five times slower. 

 Utilization of multiprocessor architectures: The benefits of multi threading can be greatly increased in a multiprocessor architecture, where threads may be running in parallel on different processors. A single threaded process can only run on one CPU, no matter how many are available. Multi threading on a multi-CPU machine increases concurrency. 



Post a Comment

0 Comments