3 ms·
My definition is this: * Concurrency is a property of relationships between tasks in the problem (or the algorithm). Is fetching one page for example independe
by rdtsc 13y ago
My definition is this:
* Concurrency is a property of relationships between tasks in the problem (or the algorithm). Is fetching one page for example independent of another one. If could be so it is concurrent, but it also might not be true, if it is a child page. You have to fetch one page, look at links and then fetch those pages. To the tasks have hard coded sequence so those are not concurrent.
* Parallelism is how that algorithm or problem is solved or executed. It could be that you can execute all concurrent units at the same time so you achieve parallelism, which is great. Or it could be that due to a particular architecture or other reasons you execute it serially. Maybe you just have a while loop and fetch one page, wait fetch another one. The problem is concurrent but it is not run in parallel.
Notice my definition doesn't include CPU or IO in there. In real world there is both. CPU concurrency interleaved with IO concurrency. That you can then end up running none, one or both in parallel when you execute.
- skyraider 13y agoTo simplify: Concurrent tasks complete in the same, overlapping time period. Parallel tasks run at literally the same time.
- scott_s 13y agoYes. And this implies that concurrent is not necessarily parallel, but parallel is always concurrent. A way to keep the notions straight is that if you're implementing a kernel that will only ever run on one core, you still have to worry about concurrency: all processes, including the kernel, are time-sharing the single core.
- barrkel 13y agoparallel is always concurrent I don't really agree. The heart of the problem of concurrency is non-determinism, but it's perfectly possible to have deterministic parallel algorithms. Normally the key is not letting the parallel operations interact with one another. So to me, a useful (for discussion) definition of concurrency involves multiple logical tasks, overlapping in time, and interacting with one another, in a non-deterministic way. Whereas parallelism is concerned with taking advantage of physical hardware that can do more than one thing simultaneously. And concurrency does not imply parallelism, nor does parallelism imply concurrency, under my understanding. In particular, data parallelism like SIMD or CUDA is not concurrent.
- rdtsc 13y ago> So to me, a useful (for discussion) definition of concurrency involves multiple logical tasks, overlapping in time, and interacting with one another, in a non-deterministic way. Hmm, I would think it would be the opposite, they're concurrent precisely because they don't have to interact. They can run independently. 2 requests from a server are concurrent because they don't have to know about each other and don't have to interact with each. This is a property of the problem domain (idealized web requests) this doesn't tell us anything about how they'll run (in parallel or not). > Whereas parallelism is concerned with taking advantage of physical hardware that can do more than one thing simultaneously. I agree with that. > And concurrency does not imply parallelism, nor does parallelism imply concurrency, under my understanding. In particular, data parallelism like SIMD or CUDA is not concurrent. Don't quite agree with that and don't see why SIMD algorithms have to be a special case. Maybe you compute a dot product between 2 vectors. If you write the algorithm down you have a bunch of multiplications and a sum. You notice that it has a lot of concurrency (the algorithm). If you don't have SIMD you could spawn a thread to multiply out each pair and then to sum. That would be silly. But you'd run in parallel. You could just do it sequentially with a for loop. But if you have SIMD, it know how to run those concurrent algorithmic steps in parallel.
- RivieraKid 13y agoAccording to wikipedia: In computer science, concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other. But it doesn't really matter, what matters is whether people understand each other, not whether they're using the "correct" words.
- rbanffy 13y agoIt worries me people when people think they understand each other while using the wrong words.
- RivieraKid 13y agoIf they really do understand what each other is trying to say, it doesn't matter much what words they're using. What annoys me is when half of the comments is about form, not about substance. It's understandable, people (including me) love to correct mistakes of other people, but it still annoys me.
- rbanffy 13y agoWhen people start misusing a word, it loses its original meaning. There is an avoidable period of confusion between the moment people start using word A to mean a subset of A and when everyone agrees A refers to a subset of what previously was A. I like to avoid confusion whenever possible.