Parallelism vs Concurrency

  Рет қаралды 12,755

CodeVault

CodeVault

Күн бұрын

Пікірлер: 20
@kapildeshmukh7878
@kapildeshmukh7878 3 жыл бұрын
Thanks a bunch. I have my Linux finals on 19th Jan. This was a godsent.
@bsgamer5069
@bsgamer5069 3 жыл бұрын
Your explanation is just amazing. I have a job interview next Thursday. I will comment if I get hired 😁. And I have posted your channel link to Facebook group
@0x2d26
@0x2d26 3 жыл бұрын
what's the job title?
@bsgamer5069
@bsgamer5069 3 жыл бұрын
@@0x2d26 junior developer. I will be doing programming stuffs.
@vorio5310
@vorio5310 Жыл бұрын
When I was testing how the number of threads affects speed, I encountered a very strange behavior. With one thread the time is about 2s, with two the time is 10s!!!! And when adding more threads the time decreases (with 32 threads the time is about 4s). I was running the code on a virtual machine with 4 cores. I didn't use any mutexes and sleep() functions. What is the reason for that?
@CodeVault
@CodeVault Жыл бұрын
If the workload is very small then the overhead of creating and waiting for threads plays a much bigger role. After 4 threads you shouldn't see much of a performance improvement. Do you have the exact time it take to execute for each number of threads you tested? Also, can you share the code you're trying to execute? Thanks
@fernandaeschallots2485
@fernandaeschallots2485 3 жыл бұрын
But I realized that Parallelism is more effective
@CodeVault
@CodeVault 3 жыл бұрын
Yes, ideally you want your program to run in parallel without any concurrency (or as little as possible)
@fernandaeschallots2485
@fernandaeschallots2485 3 жыл бұрын
I didn't understand anything....Google Translator probably doesn't work well
@CodeVault
@CodeVault 3 жыл бұрын
Yea... sorry, we don't have captions for other languages
@_4p_
@_4p_ 4 ай бұрын
thanks man
@antonfernando8409
@antonfernando8409 2 жыл бұрын
Would your definition still hold true when there are multiple CPUs?
@CodeVault
@CodeVault 2 жыл бұрын
Yes, of course. Multiple CPUs on the same system acts much like one large CPU
@Awwe12675
@Awwe12675 2 жыл бұрын
I know parallel used multiple core and thread is only one core But I have question what is task What is multiplthreds
@CodeVault
@CodeVault 2 жыл бұрын
Threads have different meanings based on which part of the computer you're looking at. A thread in the hardware is the number of cores the OS sees. (So if you have a 4 core 8 thread CPU, the OS sees that you actually have 8 cores and you can run 8 processes in parallel). A thread in software is just another line of execution for a process A task is usually a program that is executed completely on one single thread
@Awwe12675
@Awwe12675 2 жыл бұрын
@@CodeVault Thank you bro but I have the same issue I can’t understand If we say parallel just use core okay “ And thread is one core with the same program running okay “ task is thread like events in the same program run? And why some people say multiplethread it’s seems to me it’s threads ? Can you draw that in future videos please And sorry for my bad English
@CodeVault
@CodeVault 2 жыл бұрын
Alright, I'll see what I can do in the future
@Awwe12675
@Awwe12675 2 жыл бұрын
@@CodeVault thank you bro
@narasarajv5278
@narasarajv5278 3 жыл бұрын
Thank you..
@alienflip5492
@alienflip5492 3 жыл бұрын
Great videos mon ami!
Thread Pools in C (using the PTHREAD API)
22:54
CodeVault
Рет қаралды 42 М.
Deadlocks in C
10:59
CodeVault
Рет қаралды 26 М.
HAH Chaos in the Bathroom 🚽✨ Smart Tools for the Throne 😜
00:49
123 GO! Kevin
Рет қаралды 16 МЛН
iPhone or Chocolate??
00:16
Hungry FAM
Рет қаралды 43 МЛН
Naming Things in Code
7:25
CodeAesthetic
Рет қаралды 2,1 МЛН
Multithreading Code - Computerphile
15:54
Computerphile
Рет қаралды 385 М.
What is a mutex in C? (pthread_mutex)
9:18
CodeVault
Рет қаралды 164 М.
Concurrency vs Parallelism
9:29
Jakob Jenkov
Рет қаралды 66 М.
CONCURRENCY IS NOT WHAT YOU THINK
16:59
Core Dumped
Рет қаралды 101 М.
My 2 Year Journey of Learning C, in 9 minutes
8:42
VoxelRifts (PixelRifts)
Рет қаралды 616 М.
Practical example for pthread_mutex_trylock
13:12
CodeVault
Рет қаралды 15 М.
Beginners Should Think Differently When Writing Golang
11:35
Anthony GG
Рет қаралды 111 М.
HAH Chaos in the Bathroom 🚽✨ Smart Tools for the Throne 😜
00:49
123 GO! Kevin
Рет қаралды 16 МЛН