The following are the scenarios in which parallel programming can be useful:
- Creating a responsive UI for GUI-based applications: We can delegate all of the heavy lifting and time-consuming tasks to the worker thread, thereby allowing the UI thread to process user interactions and the UI repainting tasks.
- Processing simultaneous requests: In server-side programming scenarios, we need to process a large number of concurrent users. We can create a separate thread to process each request. For example, we can use an ASP.NET request model, which makes use of ThreadPool and assigns a thread to every request that hits the server. Then, the thread takes care of processing the request and returning ...