What is concurrent programming? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

What is concurrent programming?

Which softwares are using this technique and how efficient is this type of computing?

22nd Oct 2016, 8:55 AM
Aaron Sarkissian
Aaron Sarkissian - avatar
2 Answers
+ 6
You probably mean parallel programming, ie you can have several tasks running at the same time on different CPUs for example. Concurrent computing would be what the task scheduler of your OS aims to do for example. (Or maybe you do mean concurrent programming, and unfortunately I am more versed in parallel programming, sorry if that's the case.) You can do parallel programming in several languages. In Java, you have the class Thread. In C-derived languages, you have libraries based on the MPI norm, like OpenMP. In Python, you have a Thread module. While parallel programming aims to execute several tasks at the same time, it has a cost, and if the tasks given are too small, you may end up taking more time than if you did classic sequential programming. Sometimes, you can't parallelize. Sometimes, some tasks are done faster than the others and some threads need to wait for the completion of other threads to continue. Sometimes, two threads need to use the same resource, and one has to wait while the other finish to use that resource. In short, it's not always simple to do parallel programming efficiently. However, if you have a task that can be divided easily in several smaller tasks that each uses a different memory space, chances are you can easily parallelize with maximum efficiency. Parallel programming could be a course by itself, really.
22nd Oct 2016, 4:05 PM
Zen
Zen - avatar
+ 3
Thank you @Zen for the detailed answer
22nd Oct 2016, 5:46 PM
Aaron Sarkissian
Aaron Sarkissian - avatar