Employing multiple threads of execution in your application opens the way for many benefits impossible to achieve using just a single thread. These benefits include:
Your application can process user requests (such as printing or connecting to a remote machine) on a different thread than that of the user interface. If it were done on the same thread, the user interface would appear to hang until the other requests were processed. Because the user interface is on a different thread, it can continue to respond to the user’s request.
If the machine your application runs on has multiple CPUs and the application is required to perform multiple calculation-intensive independent operations, the only way to use the extra processing power is to execute the operations on different threads.
If your application is required to process incoming client requests as fast at it can, you often spin off a number of worker threads to handle requests in parallel.
Instead of blocking the client while the object processes the client request, the object can delegate the work to another thread and return control to the client immediately.
In general, whenever you have two or more operations that can take place in parallel and are different in nature, using multithreading can bring significant gains to your application.
The problem is that introducing multithreading to your application ...