With the implementations shown in this video, aren't we wasting a thread in the forking phase which only does the sub-dividing and then it just waits for the sub-tasks to complete? Why not use the current thread to run one of the tasks after forking?
At 4:30, I thought that there was a single queue holding tasks. The executor choose a free thread to execute the next task in that single queue. In what executor, do we have a queue of tasks for each thread?
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?
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.
@@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.
Jakob you have destroyed the fear of multithreading in my mind, I hope this video and the channel gets the popularity it deserves ❤
Thank you very much !! :-)
Jakob, you are purely a Legend. thanks a lot for the great explanations.
You are welcome! ... and thank you for your kind words! :-)
I've watched all of your videos on Concurrency and Multithreading, and they were incredibly informative. Thank you!
Thank you very much !!
I am happy you found them useful ! 😊
Thanks for this amazing playlist and clear explanations. Learned a lot from this!!!
You are very welcome! :-)
you make Java so much more interest! thank you!
Thanks a lot for your kind words !! 😊 ... and you are welcome !! 😊
Lengend Jakob thanks for your explaination on java topics with deep insight
Excellent tutorial, thank you very much!
You are welcome ! ... and thank you for your kind feedback! :-)
as always, you're the best.
thank you very much ^^
Thank you very much :-)
Bro, your tutorials are amazing..
Waiting for Structured Concurrency in java..
Thank you 😊😊 Structured concurrency is an interesting area !! ... let me see when I have time for it 😊
With the implementations shown in this video, aren't we wasting a thread in the forking phase which only does the sub-dividing and then it just waits for the sub-tasks to complete? Why not use the current thread to run one of the tasks after forking?
You could probably do that... I am not sure how much of a difference it will make, though.
At 4:30, I thought that there was a single queue holding tasks. The executor choose a free thread to execute the next task in that single queue. In what executor, do we have a queue of tasks for each thread?
Some ExecutorService implementations have a single queue holding tasks internally. But the ForkJoinPool uses multiple queues.
should I learn operating system before learning java thread ?
No, that should not be necessary :-)
if Java was the Kingdom Jakob would be the King
I am probably more of an ambassador ;-)
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?
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.
@@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.
Best videos I've seen. I'm wondering why so low views !?
Thank you !!
You will have to ask UA-cam about the views... who knows how the UA-cam algorithms actually work... 🤷♂️