What is the difference between closing a thread pool shutdown and shutdownNow?

Preface This chapter is divided into two topics How to Close Thread Pool CorrectlyThe difference between shutdown and shutdownNow 1. Thread pool example public class ShutDownThreadPoolDemo { private ExecutorService service = Executors.newFixedThreadPool(10); public static void main(String[] args) { new ShutDownThreadPoo ...

Added by sklein99 on Mon, 13 Dec 2021 21:06:43 +0200

Network communication -- > TCP

1. TCP communication For connection oriented communication, the client and server must shake hands three times and establish a logical connection before communication (Security) 1.1 communication steps The server starts first. The server will not actively request the client. The client must request the server. The client and the server establi ...

Added by rusbb on Mon, 13 Dec 2021 11:53:54 +0200

PHP learning notes

1, Object oriented programming 1. Class and object 1.1. Classes and objects Class class name {member}$object name = new class name (parameter); 1.2. Class encapsulation <?php class Person { // The following are the member properties of people, which are encapsulated private members private $name ; // People's names ...

Added by chitta_pk on Sat, 11 Dec 2021 14:46:48 +0200

Installation and use of muduo Library

Today, we started Chen Shuo Da's journey of linux multithreaded server programming to learn the muduo network library. Here we mainly record the installation of muduo in the ubuntu subsystem of WSL under win11. Firstly, since muduo uses cmake as the build system, cmke must be installed first. In addition, since muduo depends on Boost (the core ...

Added by bytes on Fri, 10 Dec 2021 16:57:53 +0200

When the data volume reaches 1000w or above, separate databases and tables are used to improve the database operation performance

Data segmentation can be divided into two ways according to its segmentation type: vertical (vertical) segmentation and horizontal (horizontal) segmentation 1.ShardingSphere-Jdbc Shardingsphere Jdbc is positioned as a lightweight Java framework and provides additional services in the Jdbc layer of Java. It uses the client to connect directly ...

Added by rp2006 on Fri, 10 Dec 2021 14:27:54 +0200

Linux environment variables and process address space

Linux environment variables and process address space //View process pid and parent process [dy@VM-12-10-centos jincheng_12_5]$ ps ajx | head -1 && ps axj | grep 3669470 PPID PID PGID SID TTY TPGID STAT UID TIME COMMAND 3669469 3669470 3669470 3669439 pts/0 3681645 S 1001 0:00 -bash 3669470 3681645 368 ...

Added by perfume on Thu, 09 Dec 2021 15:11:52 +0200

Servlet learning phase I

What is a servlet 1. Servlet is one of the Java EE specifications. A specification is an interface. 2. Servlet is one of the three major components of Java Web. The three components are: servlet program, Filter filter and Listener listener. 3. Servlet is a java applet running on the server. It can receive requests sent by the client and respon ...

Added by Hellusius on Thu, 09 Dec 2021 13:32:23 +0200

linux Server HTTP protocol content, implementation program code

http protocol 1. Introduction to http http protocol is called hypertext transfer protocol. Hypertext: not only text, but also pictures, audio, video, etc.Transmission: it is based on TCP/IP. Please transmit with a response mode.Protocol: connectionless and stateless application layer protocol. 2. Working principle http protocol works on b/ ...

Added by Loafin on Thu, 09 Dec 2021 13:20:48 +0200

Linux Capability exploration experiment

1, Test task     The principle of using Capability to achieve minimum permission is used, and the design of access control based on Capability in Linux is analyzed 2, Experimental preparation   Download Libcap    libcap   Libraries enable user level programs and   capability   Some linux distributions ...

Added by blogfisher on Thu, 09 Dec 2021 05:59:01 +0200

MySQL master-slave replication

Introduction to master-slave replication 1. Master slave replication is implemented based on binlog 2. When new operations occur in the main database, binlog will be recorded 3. Obtain the binlog of the main library from the library for playback 4. The master-slave process is asynchronous Construction of master-slave replication Pre ...

Added by kkessler on Thu, 09 Dec 2021 04:52:19 +0200