free web page hit counter
đŸ›Ąïž
Copyright Notice: This video is officially sourced and embedded from YouTube. For all copyright inquiries, reports, or removals, please contact YouTube's legal team here.
Core Dumped

Core Dumped

502,000 subscribers

⏱ 👁 623,627 views

Why Are Threads Needed On Single Core Processors

Video Overview & Insights

Join CodeCrafters and learn by creating your own: INTERPRETER, Redis, Git, Http server, Grep... in your favorite programming language:

This video was sponsored by Brilliant.
To try everything Brilliant has to offer—free—for a full 30 days, visit https://brilliant.org/CoreDumped. You’ll also get 20% off an annual premium subscription.

— @CoreDumpped

https://app.codecrafters.io/join?via=jdvillal

This video was sponsored by Brilliant.

the more i learn the less i know

— @shohan__49

To try everything Brilliant has to offer—free—for a full 30 days, visit https://brilliant.org/CoreDumped. You’ll also get 20% off an annual premium subscription.

In this video we explore the fundamentals of threads.

How do you make these videos? Manim?

— @NotDefinitelyNotMe

Questions and business contact:

contact.coredumped@gmail.com

in the video after introducing threads, in your example you put disk readings overlapping in the performing timeline
is it possible for operations on disk to perform simultaneously ? does it have its own concurrency mechanism ?

— @HosseinMardani-k1s

Sponsor my work on Github:

https://github.com/jdvillal

I think you couldn't overlap or parallelize io bursts for the same storage device

— @mistersingh6470

Join our discord server:

https://discord.gg/szyQsXfzuv

Thank you for yet another excellent video! I would love to see a video of yours, explaining why the system calls used to create threads are faster than the system calls used to create processes. No extra memory allocation (extra address space creation) for a thread, as it happens for a process? I don't know if this could be a reason or if there are other reasons, as well. To me, it's an extremely interesting topic, so i would love to see something relevant to this, by you, in the future. Keep up the excellent work of educating people on these fascinating subjects! :)

— @dimitrioskastritis7519

Follow me on twitter:

https://twittter.com/coredumpped

This is some masterpiece stuff!! Commenting so that youtube know this content is amazing!!

— @negritoojosclaros

Twitch:

https://twitch.tv/coredumpped

I do back-end network programming, with Linux OS, where use the Intel DPDK networking library. With said library I take complete control of a netdev using DPDK Poll-Mode-Driver (PMD). DPDK has facilities to mask out CPU cores where they are no longer a Linux kernel scheduling resource and become used exclusively by my network application. The DPDK lib has APIs to set a given core to run a function, where said function will have an indefinite process loop. DPDK refers to such threads as lcore threads.

This makes it possible to easily write networking app that can utilize the bandwidth potential of a netdev to full 100%. My app will typically run with 7 lcores at the low end, and on production servers will add several more. The app processes network traffic for multiple user sessions.

Several lcore threads are dedicated to handling the netdev - the queues per its RX and TX ports, then there is a generic lcore thread pool which is fed work events from a lock-free work queue.

These data plane lcore threads never block, never make system calls, never take locks, never dynamically allocate memory from the heap.

Then the control plane domain is all handled on OS native threads where all that is permitted. I built a special internal msg systems that allows the control plane threads to pass msg to data plane lcore threads without causing the lcore to violate any of their domain rules - and get a response msg back. That way the control plane can have certain actions passed to the data plane that must be performed only on the data plane. This internal msg comm is kind of a crown jewel facility.

Never see any discussion about this manner of parallel concurrency programming that DPDK has been using for over a decade, but can devise networking programs that are vastly more performant than software built using the OS networking stack and all conventional OS native threads.

— @TheSulross

More User Perspectives

@

These videos are just great.
It really sucks that I have to wait till my attention rate is ready for such inputs, otherwise I would watch that stuff the whole day like friends of mine

@lln6123
@

Please Please Please, i request you to make whole series on operating systems and network security... please please please... keep up the awesome work... lots of prayers for you...

@anumhasan5494
@

really helpful for understanding, thank you.

@rishabhnarula1999
@

You mean these kinds of heads are just walking right amongst us? Yet me here is still debating if I should improve some user-experience in a a web-app or not? I must do more.

@elkanaajowi9093
@

one thing i found of contention is that accessing text and data section concurrently is fine and not cause issues is incorrect. The threads might modify variables in incorrect order. This is where locks come into picture. You may also design your code in such a way that it is lock-free but handles concurrent access. It doesn't happen automatically.

@sahilmittal-j8v
@

Your just give universety knolowge for free like it is a joke🎉

@Rohith-t8h
@

Great stuff Sir, Could you please make it an order of all these tutorials, so that it will be helpful for students follow in a sequence.

@ankireddyambati7638
@

All fine and well, until you consider self modifying code, in x86 LOCK, XCHG, shared memory....

@JimLecka
@

I'll give u a smooch bro comere

@eyesbot-1
@

All information is in the task

@qnicks23434
@

I have read that the thread's stack are inside the heap memory zone (Child process's stack are in heap), so basically there will be only one main stack and other so called child thread's stack are just somehow heap but behave like a stack?

@Show_waiyan
@

First time I understand this topic,your channel is great and better than paid courses.
Thank you

@Ű”Ű§Ù„Ű­Ű§Ù„ŰȘميمي-Űž8م
@

This channel is a gem.

@rajatkinlekar627
@

It amazes me that they were able to come up with all of this from scratch!

@dogman7755
@

Process is an unit of execution with it's own context, where thread is a smaller unit inside a process and belong to that process's context.

@acecool1715
@

Thank you for the outstanding videos, this is fantastic to share your knowledge like that . people like you make the world a better place

@francoisbergeron1784
@

11:00 did he mean sibling threads?

@TheGryphon14
@

Excellent explaination of thread

@kimhai83
@

It's the time for concurrency and parallelism. This was something i needed. Tysm.

@alenalexander9506
@

Amazing video as usual! Liked already!

@NinosYoukhana
@

Such a wonderful piece of content. Thank you

@sdvogo1520
@

Great explanation.

@sohailsheikh7171
@

What does this look like on hardware level? As in, what does threading look like in assembly or machine language as opposed to the way a process without threading looks?

@Ryantcliff
@

Took my OS final this morning. Where the fuck were you when I needed you the most

@DirtyDanMilkMan
@

comment # 700.

@viennois0123
@

We avoid multiple processes not because "it seems wrong" it is because interprocess communication have a huge overhead. Besides the whole idea of a process is not do another thing at the same time, but isolate the processes as they do not share the same address space making a crash or vulnerability in one process not interfere on the other. That is why interprocess communication is expensive in terms of resources.

@agranero6
@

top top

@petraibsen2388
@

Threads aren't just need on single core, the are also need on multi core too. Most multi core computers are inefficiently not using all their cores at any given time

@Weibo-r6z
@

Thank you so much

@PedroSalazarOrtega-tw1jt
@

This channel is certainly One of the gem in YouTube world.... brilliant work😂

@chandankumarmishra336
@

The video, the animation is 1000/10đŸ”„đŸ”„... Too good, God bless whoever animated this, you're a genius

@AdeniyiAdebowale-yi9fc
@

Amore mio

@UCFc1XDsWoHaZmXom2KVxvuA
@

Buenos videos mi hermano!! Siga con ese buen trabajo.

@InnerClimbing
@

So is it true that I can conclude if multi-threading is for achieving concurrency, but multi-cores is for achieving parallelism?? And what is hyperthreading for? since i know that hyperthreading is splitting a core into logical "cakes" to handle multiple threads but im not sure if hyperthreading is "actually" simultaneous/ parallel and not speed-clocking as concurrency. [serious question]

@ArrenGavriel
@

6:22??

@ArrenGavriel
@

I hope that Brilliant's mascot is not chasing me like that Duolingo bird.

@ArrenGavriel
@

threads are for weaklings. real men use non-blocking IO

@protonjinx
@

This is gold
 really

@akhileshpatil7500
@

Huh?

@Eeealt
@

Damn It's going to take time to understanding it

@anandairfankurniawan7000
@

why so many people that dont believe this guy is real sound so jealous. im hispanic too, i understand why he wouldn't speak himself lol. Great work George!

@alexromeu7395
@

Great animation. I am a CS major and appreciate it.

@paulkersey2424