2

In English, the word synchronous means "happening at the same time" while the word asynchronous means the opposite (i.e. "not simultaneous or concurrent in time : not synchronous")

Why all references refer to parallel programming as asynchronous programming instead of synchronous programming like this one And why they all use the keyword async (which is an abbreviation of asynchronous) instead of sync.

For example:

  • If I have 2 consecutive methods Method1() and Method2() respectively, thenMethod2() will not start execution till Method1() finishes processing, which we call sequential processing.
  • If both Method1() and Method2() are marked with async keywords, this means Method2() will start processing without waiting for Method1() to finish.
  • So, I can describe this as parallel calling, concurrent calling, synchronous call, or anything indicating they run together without waiting.
  • Naming the second scenario Asynchronous gives an impression that they are not processing in parallel.

This if confusing, isn't it?

I am not a native English speaker, am I missing something in the English language or in the parallel programming concept?

Muhammad Gouda
  • 849
  • 8
  • 20
  • 2
    Here, asynchronous means without synchronicity, i.e. you start an operation that then proceeds _asynchronously_. – ninjalj Jan 01 '19 at 13:09
  • 1
    In parallel programming (or multithreading) threads are executed independently of each other and might be done with their job at completely different times. They are not in sync or not synchronised with each other so they are asynchronous. synchronous is not a term used in this context the same way as asynchronous. – Joakim Danielson Jan 01 '19 at 13:15
  • 1
    The "not simultaneous or concurrent in time" that *asynchronous* means in this case is not referring to the independent tasks, which may in fact be executing concurrently. It's referring to the relationship of the asynchronous subroutine with its caller: the *result* of the subroutine is "not simultaneous or concurrent" with the code that called it. – Daniel Pryden Jan 01 '19 at 16:43
  • We don't! You can have asynchronous code that doesn't run in parallel. – Paulo Morgado Jan 01 '19 at 21:25
  • 1
    This link clearly discuss that: https://dev.to/scotthannen/concurrency-vs-parallel-vs-async-in-net-3812 – Marzouk Oct 08 '19 at 14:20

1 Answers1

0

Parallel programming implies concurrently executing activities. Today, two kinds of activities are used: threads and asynchronous procedures (coroutines are special kind of asynchronous procedures). Both kinds of activities can coexist in the same program. If most or all activities are threads, then the program is called multithreaded. If most or all activities are asynchronous procedures, the program is called asynchronous. And if program consists of a single thread, then it is called synchronous. But most funny thing is when that single thread is executing asynchronous procedures (as, for example, the GUI thread in Java/Swing or Android does), the program is asynchronous at the same time!

Alexei Kaigorodov
  • 13,189
  • 1
  • 21
  • 38
  • This is more confusing :), please check the example I added to the question to clarify the source of my initial confusion – Muhammad Gouda Jan 01 '19 at 16:13
  • Parallelism does not imply concurrency the same way concurrency does not imply parallelism. – Paulo Morgado Jan 01 '19 at 21:22
  • @PauloMorgado others say "parallelism implies concurrency": https://medium.com/from-the-scratch/dont-be-confused-between-concurrency-and-parallelism-eac8e703943a – Alexei Kaigorodov Jan 02 '19 at 05:01
  • 1
    They are wrong. Concurreny means accessing the same resources at the "same" time. Code that does not access the same resources can run in parallel without concurrency. And code that accesses the same resources can run exculsivly and concurrently. – Paulo Morgado Jan 02 '19 at 17:47