Advanced synchronization tool in Java Concurrent package

The concurrent package in Java refers to the classes and interfaces under the java.util.concurrent package and its subpackages. It provides various functional supports for Java concurrency, such as: The thread pool creation classes ThreadPoolExecutor and Executors are provided; Various locks are provided, such as Lock, ReentrantLock, etc; It p ...

Posted by unkwntech on Fri, 07 Feb 2020 10:31:40 +0100

Concurrent programming 5 -- atomic operation CAS

Atom (indivisible) What is atomic operation? How to implement atomic operation? syn is based on the blocking lock mechanism. 1. The blocked thread has a high priority. 2. What if the thread that gets the lock does not release the lock all the time? 3. A lot of competition, cpu consumption, and deadlock ...

Posted by |Adam| on Sun, 02 Feb 2020 16:29:36 +0100

RSA algorithm -- using private key signature and public key verification signature

1. Symmetric encryption and asymmetric encryption Encryption technology is the most common security means. The key of data encryption technology is encryption / decryption algorithm and key management. The basic process of data encryption is to process the original plaintext file or data according t ...

Posted by Mod-Jay on Sun, 02 Feb 2020 13:47:27 +0100

Java agent learning summary

Preface Recently, because of the company's needs, we need to understand the java probe, find information on the Internet, and find a lot of data, but there are too few examples. Some of them paste the company code directly, which is too complex, and some of them are particularly simple, which is not what I want. I want an example like this: The ...

Posted by mohamdally on Sat, 01 Feb 2020 11:42:40 +0100

Builder mode and StringBuilder source code

Builder pattern Builder mode is an object creation mode, which is used to create composite objects. When an object is composed of multiple objects, and the combination may change greatly, the construction of sub objects and the combination of sub objects can be encapsulated by using builder mode. Her ...

Posted by Ziq on Wed, 29 Jan 2020 05:42:13 +0100

Java serialization 77 Integer common methods, Integer, int, String mutual conversion, automatic packing, automatic unpacking

1, On the common methods in Integer   package com.bjpowernode.java_learning; ​ public class D77_1_ { public static void main(String[] args) { Integer i1 = new Integer(10); //take Integer Type to int type int i2 = i1.intValue(); System.out.println(i2); //Important: static int parseInt(String s)String to number ...

Posted by suvarthi on Wed, 22 Jan 2020 16:23:35 +0100

Creating and using the ArrayList class

Class ArrayList What is the ArrayList class ArrayList is a variable length array that can be implemented to store data inside called elements. This class provides methods to manipulate elements stored internally. Elements can be added continuously in ArrayList, and their size grows automatically. We ...

Posted by rcity on Tue, 21 Jan 2020 07:45:25 +0100

Distributed ID - snowflake algorithm

background With the increasing business volume, the division of database is becoming more and more detailed, and the concept of sub database and sub table is also gradually implemented. The generation of primary key ID such as auto increase primary key or sequence no longer meets the demand, so the ...

Posted by rallokkcaz on Sat, 18 Jan 2020 10:12:11 +0100

Prove java object header biased lock, lightweight lock, heavyweight lock and their performance comparison

  1. Biased lock: the biased lock mode is used to bias the lock to a given lock thread. When this mode is set to the lower three bits, the lock may be biased toward a particular thread or "anonymous", indicating that it may be biased. When a lock is biased toward a given thread, locking an ...

Posted by nephish on Thu, 16 Jan 2020 07:51:45 +0100

Nginx+Tomcat realize 80 port forwarding 8080 port

Nginx+Tomcat implements port 80 forwarding port 8080. First Install Nginx Secondly, install jdk, that is, configure java environment, then install Tomcat, and then modify forwarding, proxy address and port. Install and configure Nginx Reference link: https://blog.csdn.net/Sunny_Future/article/details/81353755 Open Nginx, ...

Posted by pb4life55 on Wed, 08 Jan 2020 18:37:55 +0100