5 ms·
Unfortunately this starts with a definition of concurrency quoted from the Python wiki [0] which is imprecise: "Concurrency in programming means that multiple c
by WoodenChair 2y ago
Unfortunately this starts with a definition of concurrency quoted from the Python wiki [0] which is imprecise: "Concurrency in programming means that multiple computations happen at the same time."
Not necessarily. It means multiple computations could happen at the same time. Wikipedia has a broader definition [1]: "Concurrency refers to the ability of a system to execute multiple tasks through simultaneous execution or time-sharing (context switching), sharing resources and managing interactions."
In other words it could be at the same time or it could be context switching (quickly changing from one to another). Parallel [2] means explicitly at the same time: "Parallel computing is a type of computation in which many calculations or processes are carried out simultaneously."
0: https://wiki.python.org/moin/Concurrency https://wiki.python.org/moin/Concurrency
1: https://en.wikipedia.org/wiki/Concurrency_(computer_science) https://en.wikipedia.org/wiki/Concurrency_(computer_science)
2: https://en.wikipedia.org/wiki/Parallel_computing https://en.wikipedia.org/wiki/Parallel_computing
- Spivak 2y agoWhich while it sounds like a nit the OPs definition of concurrency means that asyncio as implemented in Python (and others) is not a form of concurrent programming.
- bmitc 2y agoCould you elaborate? While I am no fan of Python's backwards approach to multi-core programming, asyncio achieves concurrency when a coroutine reaches out to the operating system for network calls. So while two tasks in asyncio are awaiting a return from a long running network call, the operating system can be running the network calls concurrently.
- CoconutPilot 2y ago> definition of concurrency quoted from the Python wiki [0] which is imprecise: "Concurrency in programming means that multiple computations happen at the same time." Surprising to some, this is the literal definition. The word "concurrent" is a portmanteau from Latin, "con" translates as same and "current" translates as time. Concurrent literally means "same time". Comp Sci really needs to use a different word.
- WoodenChair 2y ago> Surprising to some, this is the literal definition. I don't think it's surprising to anyone that speaks English what the definition of concurrency in everyday language is. It is not the same as the computer science definition and that's unlikely to change anytime soon. Can anyone with permission fix the Python wiki?