Project structure 1.Introduce maven dependencies <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.10</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.2.2</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> View Code 2. Add druid configuration to the application.properties configuration […]
Tag: pool
Thoughts on java thread pool ThreadPoolExecutor monitoring and dynamic parameter adjustment
Table of Contents For thread pool parameters For task submission strategy Respond quickly to user requests The default strategy of java ThreadPoolExecutor is as follows The tomcat ThreadPoolExecutor strategy is as follows Process batch tasks quickly Thread pool monitoring Dynamic adjustment of thread pool parameters https://mp.weixin.qq.com/s/baYuX8aCwQ9PP6k7TDl2Ww Java thread pool implementation principle and its practice in […]
JVM-08 class constant pool and runtime constant pool
class constant pool The Class constant pool is the resource warehouse in the Class file. In addition to the description information such as the version, fields, methods, and interfaces of the class, the Class file also contains a constant pool table, which is used to store various literals and symbol references generated during compilation. Symbolic […]
Target detection algorithm improvement series: Backbone replaced by PoolFormer
PoolFormer MetaFormer is a Transformer paper written by Yan Shuicheng. The contribution of this paper mainly has two points: first, it abstracts Transformer into a MetaFormer with a general architecture, and proves through experience that the MetaFormer architecture has achieved great results in the Transformer/mlp class model. Big success. Second, by using only simple non-parametric […]
29. Analysis of the working principle of thread pool ForkJoinPool
Analysis of working principle of thread pool ForkJoinPool Algorithm question: How to make full use of the performance of multi-core CPUs to quickly sort an array of 20 million sizes? Implemented based on merge sort algorithm Merge Sort is a sorting algorithm based on the divide and conquer idea The time complexity of merge sort […]
Understanding the thread pool in Java multithreading
1. Summary 1. The significance of the existence of threads: In concurrent programming, because using processes to program is “too heavy”, threads (“lightweight processes”) are introduced at this time. 2. Thread advantages: Creating threads is more efficient than creating processes, destroying threads is more efficient than destroying processes, and scheduling threads is more efficient than […]
KeepAliveTime analysis in ThreadPoolExecutor
keepAliveTime is the time that idle threads in the thread pool wait for tasks. If this time is exceeded, the thread pool will kick the current thread out of the thread pool. Divided into two scenarios: allowCoreThreadTimeout is set to true. After all idle threads in the thread pool time out, getTask() returns null, and […]
SpringBoot+Vue blog front-end and back-end separation project 8 article details-thread pool (springboot + mybatisplus+redis+mysql+jwt+cache)
Table of Contents 1. Article details 1.1 Interface description 1.2 Involved tables and pojos 1.3 Controller 1.4 Service 1.5 Testing 2. Use thread pool to update reading count 2.1 Why use the thread pool to update the reading count: 2.2 Solution: 2.3 Thread pool configuration 2.4 Use 2.5 Testing 1. Article details 1.1 Interface Description […]
28.Thread pool ThreadPoolExecutor actual combat and analysis of its principles
Five states of thread pool The high three bits of the variable ctl of the AtomicInteger type are used to represent the status of the thread pool, and the other digits represent the number of worker threads in the thread pool. RUNNING Accept new tasks and process queued tasks The thread pool is running normally […]