What are the lockless technologies in Java to solve the concurrency problem? How to use it?

In addition to using synchronized and Lock to Lock, there are many tool classes in Java that can solve concurrency problems without locking.   1. Atomic tools In JDK 1.8, the classes under the java.util.concurrent.atomic package are all atomic classes, which are implemented based on sun.misc.Unsafe. In order to solve the concurrency proble ...

Posted by soupy127 on Wed, 16 Oct 2019 06:09:17 -0700

Comparison between locks in Java

The difference between synchronized and java.util.concurrent.lock.Lock The implementation level is different. synchronized is a Java keyword, which implements locking and releasing at the JVM level; Lock is an interface, which implements locking and releasing at the code level Whether the Lock is released automatically. synchronized release ...

Posted by Rohlan on Wed, 16 Oct 2019 04:55:49 -0700

23 design patterns of Java, detailed explanation

I collated Java advanced materials for free, including Java, Redis, MongoDB, MySQL, Zookeeper, Spring Cloud, Dubbo high concurrency distributed and other tutorials, a total of 30G, which needs to be collected by myself.Portal: https://mp.weixin.qq.com/s/JzddfH-7yNudmkjT0IRL8Q 1. Chain Of Responsibility Intent It gives multiple objects th ...

Posted by globetrottingmike on Tue, 15 Oct 2019 23:48:27 -0700

Build elasticsearch + logstash + kibana version 7.2.0

Preface Recently I saw the 7.x version of elasticsearch. In addition, I used elasticsearch frequently in the project. I simply recorded the learning process. At the beginning, I was ready to build an ELK on this machine. Building ELK - elastic search First step Select the appropriate version to download: https://www.elastic.co/cn/dow... The sec ...

Posted by refiking on Tue, 15 Oct 2019 10:50:30 -0700

Design Patterns-Dynamic Agent Principle and Writing a Dynamic Agent of Our Own by Imitating JDK Proxy

This article contains a lot of code, which may be a bit rough. You can read it selectively. The purpose of this article is to simply analyze the principle of dynamic agent, to imitate JDK Proxy to write a dynamic agent and to summarize several agents. For the introduction and explanation of the agency model, there are many high-quality articles ...

Posted by grga on Mon, 14 Oct 2019 18:13:34 -0700

Http interface call sample tutorial

Before introducing the use of HttpClient library, first introduce HttpURLConnection in jdk, because HttpClient is an open-source third-party library, which is convenient to use, but it is quite basic in jdk. Sometimes, when there is no HttpClient, HttpURLConnection in jdk can also be used. HttpURLConnection is the jdk java.net libr ...

Posted by yumico23 on Mon, 14 Oct 2019 08:23:25 -0700

java Foundation (31): Network Communication Protocol, UDP, TCP

1. Network Communication Protocol Through computer network, many computers can be connected. The computers in the same network need to obey certain rules when connecting and communicating, which is just like the traffic rules when driving on the road. In computer networks, these rules of connection and communication are called network communi ...

Posted by tcsnguy08 on Mon, 14 Oct 2019 02:40:41 -0700

Preliminary Exploration of Java Design Patterns 4: This article takes you to grasp the design patterns in JDK

Turn from https://javadoop.com/post/design-pattern Behavioral patterns Strategy mode Observer model Chain of Responsibility Model Template Method Patterns State mode Summary of Behavioral Model This series of articles will be sorted out into my Java Interview Guide warehouse on GitHub. For more interesting information, please visit my wareh ...

Posted by nicandre on Sun, 13 Oct 2019 05:35:13 -0700

Thread Foundation

Thread Foundation 1. Understanding threads in java 1) Programs in java are inherently multithreaded public static void main(String[] args) { ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(false, false); for (ThreadInfo threadInfo : threadInfos) { System ...

Posted by dave_c00 on Sun, 13 Oct 2019 01:41:50 -0700

java Foundation (21): Exceptions

1. exceptions What is an exception? The problem with Java code at runtime is exceptions. In Java, exception information is encapsulated into a class. When problems arise, exception class objects are created and exception-related information (such as the location, cause, etc.) is thrown.   1.1 Abnormal Inheritance System   Exception cla ...

Posted by sup on Fri, 11 Oct 2019 01:43:58 -0700