Java ForkJoinPool

  Рет қаралды 3,211

Jakob Jenkov

Jakob Jenkov

Күн бұрын

The Java ForkJoinPool helps you break down large tasks into smaller subtasks which can be executed in parallel using all, or some, of the CPU cores available in your computer. The Java ForkJoinPool thus helps you implement a fork and join type of work break down and parallelism.
The Java ForkJoinPool implements a work stealing algorithm which further helps utilize the CPU cores in your computer more efficiently. This work stealing algorithm is also explained in this Java ForkJoinPool tutorial.
Chapters:
0:00 Java ForkJoinPool introduction
1:18 Dividing tasks into subtasks
1:59 Fork and join process
3:48 Work stealing
7:27 Creating a ForkJoinPool code example
9:16 Submitting actions and tasks to a ForkJoinPool
10:56 RecursiveAction vs. RecursiveTask
11:55 RecursiveAction implementation example
18:28 RecursiveTask implementation example
22:32 Additional ForkJoinPool methods
X (Twitter): @jjenkov
LinkedIn: / jakob-jenkov-4a3a8
Java ForkJoinPool tutorial - text:
jenkov.com/tutorials/java-uti...
Java Concurrency tutorial - text:
jenkov.com/tutorials/java-con...
Java Concurrency video playlist:
• Java Concurrency and M...
Java Code Examples GitHub Repository:
github.com/jjenkov/java-examples

Пікірлер: 20
@zeinabrahmani-tn8rq
@zeinabrahmani-tn8rq 15 күн бұрын
I've watched all of your videos on Concurrency and Multithreading, and they were incredibly informative. Thank you!
@JakobJenkov
@JakobJenkov 11 күн бұрын
Thank you very much !! I am happy you found them useful ! 😊
@qurdedu4032
@qurdedu4032 2 ай бұрын
Jakob, you are purely a Legend. thanks a lot for the great explanations.
@JakobJenkov
@JakobJenkov 2 ай бұрын
You are welcome! ... and thank you for your kind words! :-)
@sengao7062
@sengao7062 15 күн бұрын
Lengend Jakob thanks for your explaination on java topics with deep insight
@loyyeeko1231
@loyyeeko1231 2 ай бұрын
you make Java so much more interest! thank you!
@JakobJenkov
@JakobJenkov 2 ай бұрын
Thanks a lot for your kind words !! 😊 ... and you are welcome !! 😊
@personalaccount1515
@personalaccount1515 2 ай бұрын
Excellent tutorial, thank you very much!
@JakobJenkov
@JakobJenkov 2 ай бұрын
You are welcome ! ... and thank you for your kind feedback! :-)
@kimo8154
@kimo8154 2 ай бұрын
as always, you're the best. thank you very much ^^
@JakobJenkov
@JakobJenkov 2 ай бұрын
Thank you very much :-)
@kdziolak
@kdziolak 2 ай бұрын
Thanks for the brilliant video, as always, clear and concise. I am still curious how does the async IO, CPU sharing look like. In the examples all the tasks were completed e2e. Is there a correct way of using IO, to make sure it's FJP compliant?
@JakobJenkov
@JakobJenkov 2 ай бұрын
There is no special way of using IO required. If you use blocking IO from within an ForkJoinPool, the thread will be blocked until the IO call finishes. The ForkJoinPool might start up extra threads in that case, but I don't actually know.
@kdziolak
@kdziolak 2 ай бұрын
@@JakobJenkov Thanks for the reply. I'll do some reasearch, as you point our yourself, there should be a way to get multiple tasks to share the same CPU.
@avs6362
@avs6362 16 күн бұрын
Best videos I've seen. I'm wondering why so low views !?
@JakobJenkov
@JakobJenkov 11 күн бұрын
Thank you !! You will have to ask KZbin about the views... who knows how the KZbin algorithms actually work... 🤷‍♂️
@user-bi1lk3ub8h
@user-bi1lk3ub8h 2 ай бұрын
if Java was the Kingdom Jakob would be the King
@JakobJenkov
@JakobJenkov 2 ай бұрын
I am probably more of an ambassador ;-)
@adhiprasetyo4052
@adhiprasetyo4052 2 ай бұрын
should I learn operating system before learning java thread ?
@JakobJenkov
@JakobJenkov 2 ай бұрын
No, that should not be necessary :-)
Thread Signaling in Java
23:26
Jakob Jenkov
Рет қаралды 10 М.
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 95 МЛН
ИРИНА КАЙРАТОВНА - АЙДАХАР (БЕКА) [MV]
02:51
ГОСТ ENTERTAINMENT
Рет қаралды 11 МЛН
FOOLED THE GUARD🤢
00:54
INO
Рет қаралды 64 МЛН
LOVE LETTER - POPPY PLAYTIME CHAPTER 3 | GH'S ANIMATION
00:15
Compare and Swap in Java
24:21
Jakob Jenkov
Рет қаралды 15 М.
Learning Rust! | Writing a 16bit Virtual Machine
1:37:34
Tom Marks Talks Code LIVE
Рет қаралды 4,3 М.
Async Rust Is A Bad Language | Prime Reacts
28:46
ThePrimeTime
Рет қаралды 89 М.
The Java Memory Model - The Basics
23:41
Jakob Jenkov
Рет қаралды 120 М.
Java Lock
28:51
Jakob Jenkov
Рет қаралды 43 М.
Java Happens Before Guarantee - Java Memory Model - Part 2
26:13
Jakob Jenkov
Рет қаралды 55 М.
False Sharing in Java
17:33
Jakob Jenkov
Рет қаралды 11 М.
[UPDATE] Mojo Is Faster Than Rust - Mojo Explains More
52:09
ThePrimeTime
Рет қаралды 242 М.
Мой инст: denkiselef. Как забрать телефон через экран.
0:54