There are two methods in Java8’s stream, namely the parallelStream() and Stream() methods. As the name suggests, one processes data in a parallel manner, and the other processes data in a traditional serial manner. The underlying principles of these two streams are available online. There is already a lot of introduction, so I won’t go into details here. I will just briefly talk about the usage scenarios. During the actual use of the project, we found that if the data operations include adding, deleting, and modifying, the data results may be very wrong, so it is recommended to only use it when querying data. This is because although the parallelStream() method is parallel processing, it is thread-unsafe and can be used in query operations to improve query speed. If used in operations that change data, data errors will occur. 文章导航 JAVA8でストリームのParallelStream()メソッドを使用する場合の注意事項 Các trang web nền tảng Java bằng php, wordpress và tomcat chia sẻ các phương thức cấu hình tên miền apache, máy chủ đơn và tên miền kép.