Blog

Filter posts by Category Or Tag of the Blog section!

Multi-threading, parallelism and Asynchronous programming

Saturday, 18 June 2016

  

Multithreading: Based on Microsoft definition, multithreading is the ability of a central processing unit to execute multiple processes or threads concurrently.  In multithreading, a single process has multiple threads of execution. If the system has multiple CPUs then it can run in parallel. In nutshell, it's all about solving simultaneously a problem to improve performances.

 

Parallel programming: is a programming technique wherein the execution flow of the application is broken up into pieces that will be done at the same time by multiple cores, processors, or computers.  It literally means using a set of resources to solve some problem in less time by dividing the work. The issue with the processor load has a connection with parallel programming in the sense that parallel programming aims to keep all computational elements as busy as possible. But simply keeping the CPU busy does not mean that you are doing parallel programming. It extends well beyond multithreading and can take place among processes running on the same machine or on different machines.

 

Asynchronous programming: usually it is used with slow tasks and when you don't want to lock other tasks of your application. For example, when some part of your application is busy for a task, other parts wouldn't wait for that task to be completed. In fact, it is a means of parallel programming in which a unit of work runs separately from the main application thread and notifies the calling thread of its completion, failure or progress.

 

 

 

 

  

comments powered by Disqus