PROOF JavaScript is a Multi-Threaded language

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

#javascript #programming #computerscience

Рекомендации по теме
Комментарии
Автор

I could feel my brain trying to stop me writing what I knew was an infinite loop but I did it anyway. I trusted you Jeff!

daedalus
Автор

Fun nerd trivia:
- A single CPU core runs multiple instructions concurrently, the CPU core just guarantees that it will appear AS IF the instructions were run serially within the context of a single thread. This is achieved primarily via instruction pipelining.
- A single CPU core often executes instructions totally out of order, this is unimaginatively named "Out Of Order (OOO) execution".
- A single core also executes instructions simultaneously from two DIFFERENT threads, only guaranteeing that each thread will appear AS IF it ran serially, all on the same shared hardware, all in the same core. This is called Hyperthreading.

And we haven't even gotten to multi-core yet lol. I love you content Jeff, the ending was gold!

AlecThilenius
Автор

Also when we say "one-core, " that means "one-core at a *time*" -- computer kernels are concurrent by default, and the program's code will actually be constantly shifting to different CPUs, as the kernel manages a queue of things for the processor to do. Not too unlike the asynchronous system that javascript has, kernel will break each program you're running into executable chunks, and has a way to manage which programs and code get more priority.

RedlinePostal
Автор

That chef analogy about concurrency and parallelism was genius. Makes it SO much easier to understand the differences.

WolfPhoenix
Автор

Moments like 0:52, the short memorable description of callback functions, is what makes you a great teacher. Thanks man!

JThompson_VI
Автор

Love to see jeff going in depth on this channel, would love more videos like this one.

elhaambasheerch
Автор

It's a pretty good overview on how much more of a clusterfuck the code becomes once you add workers to it. And it didn't even get to the juice of doing fs/database/stream calls within workers and error handling for all of that.

raenjoyer
Автор

6:13 To see how all of your cores utilizing, you can change the graph from 'Overall utilization' to 'Logical Processor' just by right clicking on the graph -> Change graph to -> Logical Processor.

srejonkhan
Автор

I'd like to see a video on JavaScript generators and maybe even coroutines.

BRBS
Автор

Thanks for shouting out code with ryan! That channel is criminally underrated

yss
Автор

Little known fact, you can also do DOM related operations on another thread. You have to serve it from a separate origin and use the Origin-Agent-Cluster header, and load the script in an iframe. But you can still communicate with it using postMessage, and avoid thread blocking with large binary transfers using chunking. This is great for stuff that involves video elements and cameras.

I use it to move canvas animations (that include video textures) off the UI thread, and calculating motion vectors of webcams.

nuvotion-live
Автор

It would be nice if you right click on the cpu graph and *Change graph to > Logical Processors*, so we can see each thread separately.
Thanks!

ahmad-murery
Автор

That ending was possibly one of your best pranks ever, a new high watermark. Congratulations 😂

fed-yum
Автор

Task Manager --> Performance tab --> CPU --> Right click on graph --> Change graph to --> Logical Processors

boris---
Автор

although it's called concurrent, schedulers still can only work on one task at a time. It will delegate a certain amount of time to each task and switch between them (context switching). The switch Is just fast enough to make it seem truly "concurrent". If a task takes longer than the delegated time, the scheduler will still switch and come back to it to finish.

wjlee
Автор

just a heads up for your CPU; the 12900K doesn't have 8 physical cores, it indeed has 16, 8 performance and 8 efficiency cores, the performance cores have hyperthreading enabled but not the efficiency cores so you have 24 threads in total

deneguil-
Автор

the `threads` package makes working with threads much more convenient. it also works well w/ typescript.

kiprasmel
Автор

Lots of comments about memorable descriptions, shoutout to the thread summary at 3:30. Your conciseness is excellent.

EdgeGaming
Автор

My brain: dont run it
8 years of programming: dont run it
the worker thread registering my inputs to the console as I type it: dont run it

Jeff: run it.
**RUNS IT**

maxijonson
Автор

This man just explained a lot within 8mins! Getting your pro soon.

mrainaandroid