Redis distributed lock (illustration - second understanding - the most complete in History)

The article is very long, it is recommended to collect! High concurrent enthusiast community: Crazy maker circle Offer the following valuable learning resources to the children: Crazy maker circle classic books: Classic "high concurrency trilogy of Java" Necessary for interview + necessary for large factory + necessary for salary i ...

Posted by thessoro on Thu, 17 Feb 2022 22:23:03 +0100

There are two bugs hidden in the source code of Java 8 ConcurrentHashMap

I suggest you take a look at the source code of concurrent HashMap of Java 7. The source code of that version is a textbook of Java multithreaded programming. In the source code of Java 7, the author is very cautious about the use of pessimistic locks. Most of them are converted to spin lock and volatile to obtain the same semantics. Even if th ...

Posted by Devil_Banner on Thu, 17 Feb 2022 22:12:50 +0100

Reflection and annotation

Class loading concept and class loading timing Class loading concept When the class file is loaded into the jvm, a class object will be created accordingly; It is divided into three steps: loading, connecting and initializing load: Load the class file into the memory area and generate a class object accordingly connect: Verify: ve ...

Posted by cheese on Thu, 17 Feb 2022 21:31:48 +0100

Configuring a nacos cluster with nacos+nginx

SpringCloud Alibaba Nacos What is Nacos Nacos is the first two letters of Naming and Configuration, and the last S is Service A dynamic service discovery, configuration management and service management platform that is easier to build cloud native applications Nacos is the combination of registration center + configuration center Eureka+C ...

Posted by cjacks on Thu, 17 Feb 2022 20:45:03 +0100

Three questions: understand hash table and hash conflict

What is a hash table? Hash tables, also known as hash tables, are array based. This indirectly brings an advantage: the time complexity of search is O(1), and of course, its insertion time complexity is also O(1). There is also a disadvantage: the expansion cost is high after the array is created. There is a "mainstream" idea in hash ...

Posted by ghornet on Thu, 17 Feb 2022 20:40:36 +0100

Deep understanding of thread pool Fork Join in concurrent programming

Deep understanding of thread pool Fork Join in concurrent programming 1, What is Fork Join Maybe junior programmers don't know what Fork Join is. Let's take a simple example to illustrate: Suppose we need to send 10W emails in groups, which method may we use? Some people may say that using threads or thread pools, each thread sends ...

Posted by mazman13 on Thu, 17 Feb 2022 20:16:09 +0100

java - API about time

API for time and date before JDK8 1. currntTimeMillis() in System; This method will return a time difference (also known as timestamp) in milliseconds from 0:0:0 in January 1970 to the present >public class DateTimeTest { public static void main(String[] args) { long time = System.currentTimeMillis(); System.out.println( ...

Posted by ranbla on Thu, 17 Feb 2022 18:50:49 +0100

[data structure] Java implementation of eight sorting algorithms

methodaverage timeWorst timeExtra spacestabilityBubble sortingO(n2)O(n2)O(1)stableSelect sortO(n2)O(n2)O(1)instableInsert sortO(n2)O(n2)O(1)stableCardinality sortO(d(n+r))O(d(n+r))O(d+r)stableShell Sort O(nlogn)O(n2)O(1)instableQuick sortO(nlogn)O(n2)O(nlogn)instableMerge sortO(nlogn)O(nlogn)O(1)stableHeap sortO(nlogn)O(nlogn)O(1)instable 1. In ...

Posted by souravsasi123 on Thu, 17 Feb 2022 18:28:20 +0100

Personal development experience -- my java learning path (school chapter)

Personal introduction: Name: not here Contact information: Platform: QQ / wechat / Xiaopo station / gitHub gitHub: https://github.com/kkzxm Unified nickname: cool house Xiaoming head portrait: Code perception: Less code means less bugs and less maintenance costs! On the number of lines of code to determine the salary... I dare not ju ...

Posted by discombobulator on Thu, 17 Feb 2022 18:19:57 +0100

Summary of java multithreaded producer consumer model

catalogue Introduction to producer consumer model wait,notify scheme Implementation of ReentrantLock Implementation of blocking queue Semaphore implementation Lockless caching framework: Disruptor Note: This article refers to [Java summary] producer consumer model_ zhujohnle's column - CSDN blog Java implementation of producer consumer ...

Posted by sandingmachine on Thu, 17 Feb 2022 17:14:20 +0100