Multithreading vs Multiprocessing | System Design

preview_player
Показать описание

In this video, we dive into the key differences between multithreading and multiprocessing, two powerful approaches to achieving concurrency in programming. Whether you're building applications that handle multiple tasks at once or you need to maximize CPU performance, understanding when to use multithreading versus multiprocessing is critical for optimizing your code.

You'll learn:

What multithreading is and how it allows multiple threads to run within the same process.
The benefits of multithreading for I/O-bound tasks and the challenges like synchronization complexity and the Global Interpreter Lock (GIL) in Python.
What multiprocessing is and how it runs multiple processes with separate memory spaces, enabling true parallelism.
The pros and cons of multiprocessing for CPU-bound tasks, including higher memory overhead and complex interprocess communication.
Real-world examples of multithreading in web servers and multiprocessing in data analysis applications.
By the end, you'll know exactly which approach to choose depending on whether your application is I/O-bound or CPU-bound. If you want to write efficient, scalable code that maximizes your system's resources, this video is for you

👍 If you found this video helpful, make sure to like, subscribe, and hit the notification bell for more in-depth tech explainers!

#Multithreading #Multiprocessing #Concurrency #Python #Programming #TechExplainer #CPU #IO
Рекомендации по теме
Комментарии
Автор

Today
crete like this I have found these videos about CPUs to be suitable for a competent beginner yet also detailed. I have been spending some time recently trying to learn about CPUs/computers, and so it is helpful to have a beginner video which gets me going far enough to understand the concepts at a basic level but without leaving out details, so that I can know what to learn next at a higher level. I have also found your explanations to be quite clear. Your videos have been very helpful for me. Thank you!
It’s fantastic to see your enthusiasm for learning about CPUs and computers! While I don’t create videos myself, I’m thrilled to hear you’ve found resources that balance beginner-friendly explanations with enough depth to inspire further exploration. It sounds like you’re already on an excellent learning path.

gayanwego
Автор

If this video was released just a few days ago, i would have passed my OS exam :)
Nice explanation!

kairavb
Автор

Great work! While I agree with most of it, I think you might have missed something. And that is, the benefit of multiprocessing is not really 'true' parallelism. This is because you get 'true' parallelism with multithreading as well. In fact, multithreading will often be the right way to go as opposed to multiprocessing because of how resource intensive it tends to be.

Especially with CPU-bound tasks as you mentioned, multithreading can be extremely beneficial in that respect. Even more beneficial than multiprocessing.

deezydoezeet
Автор

I would say that stating multi threading is best for I/O bound is skipping over the fact that you gain MOST of the benefit from just releasing your threads using async patterns, for example you can use asyncio library with one thread and still go and kick off 3 separate I/O calls to get data at basically the same time, so if that was the main benefit you were after multi threading isn't giving you much more. Great video though!

alexandermackintosh
Автор

Nice visuals and explainantion!!! Where did you get those icons? or did you designed it yourself?

foxxie_
Автор

These are good and simple explanations, and the BGM is relaxing!

truthastyle
Автор

Hello good video so which one I should use
I don't want my apps to be CPU & RAM eaters bound
which one to go with according your opinion in this ?

officialyashvirgaming
Автор

In fact you can use shared memory in IPC and run threads in different cores in C using pthreads. I thinks this exposition is very biased towards modern software technologies and not towards the fundamentals of operating system concepts.

pubdigitalix
Автор

truly interesting. thanks for sharing.

anyway, I found asyncio is a more lightweight solution to handle heavy I/O bound concurrent processes.

could you later make a comparison just like this multithreading VS multiprocessing?

adipriyanto
Автор

WHY IS THERE MUSIC??? IT MAKES THIS UNLISTENABLE! Dislike.

niflag
Автор

Dude, dont use thread for i/o bound task. This is shit instructions. You use asynchronous operations instead.

IamAWESOME
join shbcf.ru