Is it concurrent or parallel?

  Рет қаралды 18,312

Jacob Sorber

Jacob Sorber

Жыл бұрын

Patreon ➤ / jacobsorber
Courses ➤ jacobsorber.thinkific.com
Website ➤ www.jacobsorber.com
---
Is it concurrent or parallel? Concurrency and parallelism confuse a lot of new programmers and students of computer science-especially when studying operating systems, high performance computing, threads, and similar systems topics. This video tries to clarify the difference. I hope it helps.
***
Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.
About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.
More about me and what I do:
www.jacobsorber.com
people.cs.clemson.edu/~jsorber/
persist.cs.clemson.edu/
To Support the Channel:
+ like, subscribe, spread the word
+ contribute via Patreon --- [ / jacobsorber ]
Source code is also available to Patreon supporters. --- [jsorber-youtube-source.heroku...]

Пікірлер: 47
@alancanalesmujica6878
@alancanalesmujica6878 7 ай бұрын
I tried to keep this in mind “Concurrency is a software mechanism and parallelism is a hardware concern”
@ibrahimfikry6624
@ibrahimfikry6624 2 ай бұрын
thanks
@kqvanity
@kqvanity 21 күн бұрын
They're both achieved through software
@shehabbadawy9523
@shehabbadawy9523 Жыл бұрын
i know this is maybe off-topic, but can you make a video about distributed systems and perhaps MPI ?
@lucasheuman
@lucasheuman Жыл бұрын
Glad to see you putting out more videos!
@samarthtandale9121
@samarthtandale9121 Жыл бұрын
Keep uploading ... These videos are very insightful !
@johnpawlicki1184
@johnpawlicki1184 Жыл бұрын
My interpretation has always been the same. I always think of "parallel processors" which requires more than one core. 🙂
@sudharakafernando4391
@sudharakafernando4391 2 ай бұрын
Well explained... thank you !!!
@rmcgraw7943
@rmcgraw7943 7 күн бұрын
The way I think of it is that Parallelism is the parent of concurrency. That is, parallelism deals with multi-threading, and is constrained by hardware implementations; to effectively process task in parallel, task run at the same time and should be divided to as atomic as possible, accessing no shared (or unprotected/locked) data simultaneously. Concurrency could or could not timeslice between task, depending on the Task Partitioner, hyperthreading, etc, but it does not concern itself with the partitioning of tasks/data; concurrency IS running things while parallel is the identification of how things can be run in a thread safe manner, concurrently. It’s been a while since I worked with System.Threading namespace, but that’s how I remember it.
@remotetechie6910
@remotetechie6910 5 ай бұрын
Loved this explanation
@peterlin5857
@peterlin5857 Жыл бұрын
Hey Jacob, really enjoy your videos, could you make a topic about RISC-V?
@PetreRodan
@PetreRodan Жыл бұрын
multiprocessor execution surely does not imply parallelism. while I have 16 physical cores, I also have 587 processes running, so the OS will have to resort to scheduling (what you define as concurrency).
@ricardoamendoeira3800
@ricardoamendoeira3800 6 ай бұрын
Unless only one of the cores is working at each moment, surely you're executing more than one process at the same time, and thus have parallel execution?
@filips7158
@filips7158 Жыл бұрын
You only get real parallelism in multicore bare metal processors and FPGA/ASIC. Everything else is concurrent or concurrently parallel. This is because there is a clear separation of concerns between the OS operation and software you develop on top of OS functionalities.
@SpooningTreesap86
@SpooningTreesap86 Жыл бұрын
This is the way I've learned and understood it as well, granted I've had to double check and google it a few times when I forgot 😁
@DM-qm5sc
@DM-qm5sc Жыл бұрын
An example would help me understand this better
@brianb2308
@brianb2308 Жыл бұрын
Could you do a video on atomics sometime? I've only ever used mutexes for making multithreaded code safe and it seems like it's a bit limiting in certain circumstances
@_voidpointer5447
@_voidpointer5447 11 ай бұрын
They done it :) Check the last video «Making variables atomic in C»
@xhivo97
@xhivo97 Жыл бұрын
Have you seen "Modern C and we can learn from it?" I wonder what you think on that as it's quite different from the usual way you'd use C.
@maxaafbackname5562
@maxaafbackname5562 Жыл бұрын
If two completely independent tasks are run in parallel, is that (still) concurrent? (Referring to the last diagram.)
@kaiweiyeo4279
@kaiweiyeo4279 10 ай бұрын
Hi Jacob, For the diagram at 3:25 , can an application be parallel and not concurrent? That would contradict the diagram. "An application can be parallel but not concurrent, which means that it processes multiple sub-tasks of a single task at the same time."
@givemecoffeeee42
@givemecoffeeee42 5 ай бұрын
Great question! I think basically that's why threads were created, some tasks have multiple subtask inside so those are what actually interest you, not the big one. So you create threads of execution that run concurrently and ideally in parallel due to multithreaded processors. Now, i guess if you have multiple cores with multiple threads each, your processes are running in a parallel fashion, with threads running concurrently on each individual thread of the processor. For example, a processor with 2 cores with one thread of execution each can run one thread of one process on one core and another thread of another process on the other core, while threads are executed concurrently waiting for their turn on the core.
@saurabhshinde1855
@saurabhshinde1855 Жыл бұрын
These diagrams helped me to visualise it better Concurrency... _ _ _ _ _ Parallelism : _ _ _ _ _ _ _ _ _ _
@sfa22
@sfa22 Жыл бұрын
Both of them have "Concurency". First one has ("Concurency" without "Parallelism") and second one has both ("Concurrency" and implicitly "Paralelism"). I do like your representation with the lines :)
@irispounsberry7917
@irispounsberry7917 Жыл бұрын
Instead of using synonyms to confuse people, why didn't they just call "a single core juggling several processes" what it is: multitasking, as that is what it is called when a person does it. Or does that mean something else entirely in CS?
@johnsullivan8673
@johnsullivan8673 Жыл бұрын
Do you know what a semaphore is?
@yash1152
@yash1152 10 ай бұрын
my summary of this video: * Concurrency means: overlap in their turning-around period * Parallelism means: overlap in their actively running time
@JustinCromer
@JustinCromer Жыл бұрын
How do we get to redefine English words to mean what we want? The definition of ‘concurrent’ says “two or more things happening at the same time.” 10/10 would fail this quiz question and be okay with it.
@JacobSorber
@JacobSorber Жыл бұрын
Indeed. Redefining imprecise natural language to meet our specific needs is kind-of what we tech people do.
@JustinCromer
@JustinCromer Жыл бұрын
@@JacobSorber :(
@Sakuraigi
@Sakuraigi 4 ай бұрын
​@@JacobSorbertech language is so bad
@FEFFeX
@FEFFeX Жыл бұрын
Thank you so much for your awesome videos. Would you do some series on Rust.
@anon_y_mousse
@anon_y_mousse Жыл бұрын
I hope not. No one should be using it.
@bapi6060
@bapi6060 Жыл бұрын
I'm downloading a file in my web browser and meanwhile I am watching your KZbin video. Are both happening parallelly or concurrently?
@ohwow2074
@ohwow2074 Жыл бұрын
It depends on your hardware and OS. If you're using a modern multicore system then most probably they're running in parallel. Especially since those two processes have nothing to do with each other and are independent.
@meluobote7664
@meluobote7664 Жыл бұрын
can two thread in the same process run in different cores and implement parallism?❤
@sfa22
@sfa22 Жыл бұрын
Ofc they can. Since you wrote "different cores' I assume you have more than 1, else they are not different.
@artemetra3262
@artemetra3262 Жыл бұрын
is async computation concurrency?
@The-Real-Jack
@The-Real-Jack Жыл бұрын
Yes
@andrewporter1868
@andrewporter1868 Жыл бұрын
@@The-Real-Jack This is incorrect. Asynchrony has nothing to do with concurrency in itself. Asynchrony is merely the absence or privation of synchrony.
@ohwow2074
@ohwow2074 Жыл бұрын
It can be both based on the programmer's decision. It can run on a separate hardware thread or it can run on the same thread sequentially.
@The-Real-Jack
@The-Real-Jack Жыл бұрын
Async isn't necessarily "true" concurrency in the sense of multithreaded concurrency (though it can be), but even in the case of single threaded async, it allows you to unblock further events and actions while your other instructions continue executing, practically allowing things to happen at the same time, even if they're not technically truely simultaneous. Whether you consider that concurrent or not is mostly semantic.
@meluobote7664
@meluobote7664 Жыл бұрын
yes or not, bcause the distributed task don't have to be ran immediately
@gloverelaxis
@gloverelaxis Жыл бұрын
DO NOT USE THESE DEFINITIONS this is a REALLY, REALLY bad relationship of names and it causes everyone tangible harm to advocate these names for these concepts. "parallel" and "concurrent" in the context of time are synonymous in the English language, and so using "concurrent" as the name for something discretely different from "parallel" is REALLY, REALLY confusing and semantically misleading. call this concept of rapid OS context switching "scheduling", "round robin", "taking turns", "context switching", "time sharing", "time-slicing", "time-rationing", "focus-swapping", "pseudo-parallism", "virtual parallelism", "interleaving", "task dithering", "sequential sharing", or literally ANYTHING else. PLEASE stop giving things horrible names. PLEASE. computer science has way too fucking many bad names already. "concurrent" is literally THE word in the English language for when multiple things are happening at the same time. PLEASE do not use that word to refer to something where multiple things are explicitly NOT actually happening at the same time. this kind of thoughtless, rote repetition of extremely stupid traditions is exactly what's wrong with so much of programming.
@anon_y_mousse
@anon_y_mousse Жыл бұрын
Programmers use terms in set X, mathematicians use set Y and "civilians" use set Z, and never the twain shall meet. That's life, get used to it and grow up or get out while you can. Another one that'll trip you up is thinking that terms stay the same for all time, because human beings can and will change the dictionary as often as they can. Go back to the 1950's and you'll more or less be able to have a casual conversation with someone, but go back another 70 years and you might not understand anyone. Something to ponder, if the average is at a specific level, then roughly half, give or take, will be below that average.
@sparkcodez
@sparkcodez 9 ай бұрын
TF
@Sakuraigi
@Sakuraigi 4 ай бұрын
Completely agree. Computer Science uses trash language
A const int is not a constant.
9:16
Jacob Sorber
Рет қаралды 65 М.
How to Inspect Compiled Binaries (binutils, objdump)
7:53
Jacob Sorber
Рет қаралды 41 М.
Super gymnastics 😍🫣
00:15
Lexa_Merin
Рет қаралды 73 МЛН
Hot Ball ASMR #asmr #asmrsounds #satisfying #relaxing #satisfyingvideo
00:19
Oddly Satisfying
Рет қаралды 28 МЛН
This is why understanding database concurrency control is important
9:05
Shared Memory with Memory Mapped Files
16:58
Pavel Yosifovich
Рет қаралды 1,2 М.
What happens at the Boundary of Computation?
14:59
Mutual Information
Рет қаралды 58 М.
Making variables atomic in C
11:12
Jacob Sorber
Рет қаралды 35 М.
Concurrency vs Parallelism
9:29
Jakob Jenkov
Рет қаралды 61 М.
CONCURRENCY IS NOT WHAT YOU THINK
16:59
Core Dumped
Рет қаралды 84 М.
How to use the NEW Microsoft Planner in Teams
11:31
Teacher's Tech
Рет қаралды 42 М.
The Worst Programming Language Ever - Mark Rendle - NDC Oslo 2021
1:00:41
NDC Conferences
Рет қаралды 1,3 МЛН
Super gymnastics 😍🫣
00:15
Lexa_Merin
Рет қаралды 73 МЛН