High concurrency
The system processes many requests in parallel .
junit Test code
package com.example.mybatis; import java.util.concurrent.CountDownLatch;
import org.junit.runner.RunWith; import
org.springframework.boot.test.context.SpringBootTest; import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@SpringBootTest @RunWith(SpringJUnit4ClassRunner.class) public class Test {
// Concurrent quantity private static final int THREAD_NUM = 10000; private CountDownLatch cdl
= new CountDownLatch(THREAD_NUM); @org.junit.Test public void fun() { for (int
i = 0; i < THREAD_NUM; i++) { Thread t = new Thread(() -> { try { // Minus one
cdl.countDown(); // wait for cdl.await(); } catch (InterruptedException e) {
e.printStackTrace(); } // Concurrent execution ( Business here .) System.out.println(" Concurrent execution ."); });
t.start(); } try { // After the sub thread is created, the main thread exits , There is no waiting for the child thread job , So wait for the child thread job first . Thread.sleep(1000);
} catch (InterruptedException e) { e.printStackTrace(); } } }
 

Technology
©2019-2020 Toolsou All rights reserved,
VUE+Canvas Achieve desktop Pinball brick elimination games C/C++ Memory model 2019PHP Interview questions ( Continuously updated )PHPspringboot2 Separation of front and rear platforms ,token Put in header Pit for verification Vue SpringBoot conduct Excel download element-ui Step on pit record 45 The 12-year-old programmer was turned down , Is the workplace wrong ?Python Web frame Pandas Fundamentals of statistical analysis _ data processing (DataFrame Common operations )Java Misunderstanding —— Method overloading is a manifestation of polymorphism ?