In this video we will learn about the Parallel streams in java which is introduced in java 8. Parallel Stream can be used to achieve faster data processing. While processing data in a sequential stream , only main thread is involved in processing the data.
Activating parallel data processing in a java stream is quite easy. We just need to call the parallel() method over a stream and we are all set. The parallel stream behind the scene uses the Java's fork and join framework to split your data stream into sub tasks. The chunks of data then processed by all of your cpu cores , in parallel.
Considering a 4 core cpu, 4 threads can , at a time process the entire data stream and complete the data processing much faster then a sequential stream.
We will learn about the parallel stream in depth in this video and also we will see how it is different then multi threading.
Timestamp
--------------------
00:00:00 - Parallel Stream in Java 8 - Intro
00:04:00 - Single core CPU and threading
00:07:48 - parallelism Vs Multithreading
00:07:28 - Multi core CPU and Parallel Programming
00:10:04 - Parallel Stream - How it works ?
00:19:09 - Parallel Stream - Performance Test (coding)
00:26:45 - Fork and Join Framework in Action
00:44:48 - Sequential Stream vs Parallel Stream
00:54:52 - how to test a stream pipeline parallelism ?
00:58:12 - forEach() vs forEachOrdered()
01:07:14 - Thread Safety in Parallel Stream
01:10:25 - iterate method in stream api
01:20:20 - Inconsistent output in parallel stream - Solution
01:30:19 - When to use parallel Stream ?
01:42:28 - reduce() with parallel stream
01:50:25 - Collectors.toList() vs Collectors.toCollection()
02:02:24 - How collect() method works internally ?
02:17:31 - takeWhile() in parallel stream
02:23:03 - Bonus Reference: How java stream works ?
#javastreams #streamapi #javaprogramming #javatutorial
Parallel stream in java is a very important interview question for any java interview, so make sure to do some hands on this topic to get ready for your next java interview.
For More free/paid courses visit
www.seleniumexpress.com
LINKS AND FREE LEARNING RESOURCES
========
Watch my new mock interview series for java developers
https://youtu.be/yX2w-Sof95s
Watch Spring boot Hot topics
https://youtu.be/CUQWZHjuq-w
Java Interview / Question and Answer series
https://youtu.be/Y1uGGTrBYKw
Explain spring Bean Lifecycle
https://youtu.be/hUYGGqoXEPc
spring core
https://www.youtube.com/watch?v=r2Q0Jzl2qMQ&list=PL3NrzZBjk6m-nYX072dSaGfyCJ59Q5TEi
spring mvc
https://www.youtube.com/watch?v=zCHrZdJODg4&list=PL3NrzZBjk6m-OSeL3DRMD_ISa0u-9c1l1
spring mvc intermediate
https://www.youtube.com/watch?v=40YaLHbrwrY&list=PL3NrzZBjk6m_2jw8sC0BkEwSPFHxgQDWr
Spring JDBC
https://www.youtube.com/watch?v=5j_vh1b9dV8&list=PL3NrzZBjk6m-rYTKze-5Y5RvU8eykal4j
spring live project
https://www.youtube.com/watch?v=m_b_FwDjAXM&list=PL3NrzZBjk6m-9CVPueDLLermojwtfuW_f
SPRING SECURITY COURSE[NEW]
https://youtu.be/NMNLozLGT1s
For more courses visit
https://www.seleniumexpress.com
Any time you are getting stuck with issues, Feel free to ask for support.
You can send mail to seleniumexpress@gmail.com
you can ping me on my Facebook page
https://www.facebook.com/seleniumexpress
Make sure to join my private Facebook page (Ask me here)
“SeleniumExpress - Support"
https://www.facebook.com/groups/187000222361579/
you can ask for support in my website forum
https://www.seleniumexpress.com
Subscribe to my youtube channel
Follow me on Insta
https://www.instagram.com/selenium_express/