What are the differences between Asymchronism, Parallelism and Multithread?

Asked

Viewed 37 times

4

Sometimes the terms Asynchronous, Multithread and Parallelism appears whenever I do a search related to multiprocessing or something related. However, I have a hard time understanding the differences between them and what characteristics these terms have in common.

Issues

  • What are the differences between Asynchronous, Multithread and Parallelism?
  • What are the characteristics between Asymchronism, Parallelism and Multithread?
  • 1

    This video can also help https://youtu.be/zLfXPSeCkB8

  • Parallelism is the achieved result of two or more tasks (sequence of instructions) running at the same time and without bottlenecks, that is, in parallel, whatever the way of doing. Where the number of tasks is greater than that of processing units, this parallelism may be simulated by alternating between them according to scheduling criteria, but achieving this result still depends on how it is programmed and the type of tasks being performed and their relationship.

  • Asymchronism usually refers to a way of programming using some feature of the language to "fire" the execution of a long task parallel to the current one that called it and then continue the current one without waiting for the long/time to end. This form of execution is called "asynchronous". When both tasks are brief there is no need for this and they can be synchronous, i.e., run in sequence, as two functions being called in a normal way one after another (each "locks" until finished running and pass the control to the next).

  • Competition and concurrent programming concern the dispute for simultaneous access (concurrent) to resources shared by multiple tasks and the mitigation of problems related to this, common issue in parallelism and multi-threading. One out of the question is using mechanisms that the OS provides for this, such as Locks (locks), monitors and traffic lights, allowing controlled individual access and leaving other interested in queue waiting for the turn.

  • Finally, multi-threading and multi-thread programming refer to a concrete way to allow parallelism and asynchronicity in the same process (running program), next to how the OS works (user and kernel threads). This can be programmed directly, via threads, or abstracted by some asymchricity feature provided by the language, for example async (that may be using threads underneath the cloth). Parallelism and asynchronicity apply to processes as well, but because there is memory isolation communication involves OS CPI mechanisms.

  • Finally, a frequent problem in asymchronism is the result of the execution of the long task needs to be consumed in a way that is related to the task that had requested it (the one that had triggered this execution). For example, it needs to be returned to that same task or handled by a callback determined by it. This can be solved in different ways, according to the mechanism being used (multi-thread, async, callback functions passed by argument to the mechanism that is promoting asynchronicity, etc.).

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.