Deep understanding of Threadlocal

Preface Concurrency is an unavoidable topic in Java development.Modern processors are multi-core, and multi-threaded programming is essential for better drying machine performance, so thread security is a required course for every Java Engineer. There are two general ways to address thread security issues: Synchronization: Use the Synchronized ...

Posted by twinzen on Thu, 02 Jan 2020 06:25:07 +0100

Source code analysis Dubbo configuration rule mechanism (override protocol)

In the previous section, when explaining the RegistryDirectory, the dubbo administrator can modify the parameters of dubbo service provider online through the dubbo admin management system, and finally store them in the configurators catalog of the registry, and then notify the RegistryDirectory to update the relevant attributes in the URL of t ...

Posted by Tucker1337 on Tue, 31 Dec 2019 22:25:30 +0100

Differences between Mybatis Source Series 3-3 SqlSession s

No matter when you start, it's important not to stop after you start Three SqlSession s DefaultSqlSession and SqlSessionManager and SqlSessionTemplate are three common sqlsesion s I have From the class diagram, you can see that all three of them have implemented SqlSession, that is, they can all represent a session.Unlike others, SqlSessionM ...

Posted by LearningKid on Tue, 31 Dec 2019 03:04:33 +0100

Spring Boot 2: how to customize Servlet Filter

1. Preface Sometimes we need to declare some custom servlet filters in the Spring Boot Servlet Web application to handle some logic. For example, simple permission system, request header filtering, XSS attack prevention, etc. This article explains how to declare custom servlet filters in Spring Boot applications and define their respective sco ...

Posted by lokie538 on Mon, 30 Dec 2019 10:52:03 +0100

A comprehensive understanding of Java atomic variable classes

📦 this article and sample source code have been filed in javacore 1, Introduction to atomic variable class Why atomic variable classes are needed To ensure thread safety is an important problem to be solved in Java Concurrent Programming. Java ensures the consistency of multithreaded data by three features: atomicity, visibility and orderlin ...

Posted by phrozenflame on Fri, 27 Dec 2019 12:04:02 +0100

Elasticsearch series - Custom mapping

outline This article continues with the previous one, focusing on customizing mapping, custom objects, and the underlying structure of array collection classes. Custom mapping The previous article described the automatic mapping of Elasticsearch. When creating an index, you can specify the mapping information first, or take the music index as a ...

Posted by phpgeek17 on Fri, 27 Dec 2019 01:17:26 +0100

Analysis of Python unit test

Significance of testing For a specific problem, through analysis and design, people finally write a program in programming language. If it passes the check of language interpreter (compiler) and can run, the next step is to try to make sure that it meets our requirements. This article is about how to confirm whether the program meets the requir ...

Posted by Tagette on Wed, 25 Dec 2019 23:18:45 +0100

spring boot uses the assembly plug-in to package dependent jar s into external standalone folders

spring boot packs all dependent jars into one jar by default when it packs and runs jars. This is inconvenient because the packaged jar packages are relatively large and need to be uploaded to the server for a long time. Here, we can use the assembly plug-in to package dependent jars into external independent folders. In the future, we only nee ...

Posted by westmich on Wed, 25 Dec 2019 22:29:45 +0100

Diagram mutex inside Go Understanding programming language core implementation source code

1. Basic concepts of locks 1.1 CAS and Polling 1.1.1 cas implements locks CAS is increasingly used in lock implementations to acquire locks by exchanging values for a given variable using the processor's CAS instructions 1.1.2 Polling Lock Thread CAS failures are most likely in multithreaded concurrent scenarios, and a polling attempt to retr ...

Posted by Smicks on Mon, 23 Dec 2019 02:57:45 +0100

Elegant retry - Guava Retrying parsing

1, Retry scenario The remote call encounters current restriction or timeout, but the idempotent of the request needs to be considered in the case of concurrency, which is not the problem to be discussed here 1. When to retry -- when there is an exception or Success is false Retry policy: exception verification and result verification 2. Whe ...

Posted by noimad1 on Sun, 22 Dec 2019 10:49:40 +0100