What you should know about Java parallel stream

parallelStream action Multithreading can speed up the processing of collection operations. The underlying principle is to use the thread pool forkjoinpool (we look forward to your sharing) Must parallel streams be faster than streams? When the amount of data processed is not large, the code of "parallelStream()" is sometimes slower ...

Posted by burnside on Fri, 11 Feb 2022 16:21:38 +0100

Java time processing

Java time processing 1, Calendar (1) Introduction to Calender The Chinese translation of calendar is calendar. In fact, there are many methods of timing in history. Therefore, in order to unify timing, you must specify a calendar selection. Now the most popular and universal calendar is "Gregorian Calendar". That is, we often us ...

Posted by loudrake on Fri, 11 Feb 2022 16:14:07 +0100

Learn JdbcTemplate from Spring framework

JdbcTemplate JdbcTemplate is Spring's encapsulation of JDBC to make JDBC easier to use. The JdbcTemplate is part of Spring. The JdbcTemplate handles the creation and release of resources. It helps us avoid some common mistakes, such as forgetting to always close the connection. It runs the core JDBC workflow, such as the establishment and exec ...

Posted by Anzeo on Fri, 11 Feb 2022 15:36:38 +0100

C + + learning notes: class template

In the previous chapter, we introduced function templates. In today's chapter, we will learn class templates. Class template declaration Template is the keyword to declare a class template. It means to declare a template. The template parameters can be one or multiple. They can be * * type parameters * * or * * non type parameters** A type pa ...

Posted by dmcentire on Fri, 11 Feb 2022 13:53:38 +0100

12 scenarios of Spring transaction failure

preface For students engaged in java development, spring affairs must be familiar. In some business scenarios, the data of multiple tables needs to be written simultaneously in one request. In order to ensure the atomicity of operations (success or failure at the same time) and avoid data inconsistency, we generally use spring transactions. ...

Posted by black.horizons on Fri, 11 Feb 2022 13:31:04 +0100

Java process control

Process control Scanner object In the basic syntax we learned before, we didn't realize the interaction between programs and people, but Java provides us with such a tool class that we can get the user's input. java.util.Scanner is a new feature of Java 5. We can get user input through scanner class. Basic syntax: Scanner s=new Scanner(Syst ...

Posted by Lodar on Fri, 11 Feb 2022 12:45:53 +0100

tcp stack implementation, tcp timer and sliding window

To realize user state protocol stack, we must understand TCP, 11 states of TCP, sliding window, congestion control, timer and so on. To use the user state protocol stack, the epoll provided by the kernel will not work. We need to implement the user state epoll ourselves. Epoll involves a callback opportunity. The callback function is to add th ...

Posted by LDM2009 on Fri, 11 Feb 2022 12:07:35 +0100

Implement http server with reactor

How in reactor Based on? Is how to use reactor as a server and realize the business of the server. Based on reactor , realize simple http protocol encapsulation. Just to illustrate how reactor does business, the business logic of the real http server is very complex. The core of the server network layer, such as nginx and redis, is epoll, and ...

Posted by Discord on Fri, 11 Feb 2022 10:39:18 +0100

Basic tutorial of C + + operator overloading

Basic tutorial of C + + operator overloading The so-called overloading is to give new meaning. Function Overloading allows a function name to have multiple functions and perform different operations in different situations. Operator Overloading is also a truth. The same operator can have different functions. In fact, we have unknowingly used ...

Posted by Iconoclast on Fri, 11 Feb 2022 10:20:53 +0100

Detailed explanation of multithreading

Detailed explanation of multithreading 1, Thread introduction Processes and threads: 2, Thread Basics Common method calls and multithreading: 1. Thread creation There are three ways to create threads: Thread.class: inherits the thread class.Runable interface: implements the Runnable interface.Callable interface: implements the ca ...

Posted by Prodigal Son on Fri, 11 Feb 2022 09:42:40 +0100