Processing mechanism of chansend/chanrecv when Go channel - block is false
Preface
This article aggregates the specific processing of send and recv when selecting 2 cases (1 send/recv case, 1 default case).
For more content sharing, please follow the Public Number: Go Development Notes
chansend
select {
case c <- v:
... foo
default:
... bar
}
The bottom corresponding func is selectnbsend.
selectnbsend
// ...
Added by justinma on Wed, 09 Feb 2022 08:18:10 +0200
HashMap source code analysis
public V put(K key, V value) {
return putVal(hash(key), key, value, false, true);
}
static final int hash(Object key) {
int h;
//The final hash value is obtained by performing or calculating the high and low bits of the hash value of the key
return (key == null) ? 0 : (h = key.hashCode()) ^ (h > ...
Added by Salis on Wed, 09 Feb 2022 05:04:35 +0200
Reentrantlock AQS source code analysis
Speaking of AQS, we have to say that the classic ReentrantLock is the best embodiment of AQS However, we can briefly talk about AQS characteristics first
What is AQS?
Abstract queue synchronizer
All request threads form a CLH queue. When a thread finishes executing lock When you unlock, your subsequent nodes will be activated. The executing ...
Added by bedted on Mon, 07 Feb 2022 13:06:47 +0200
Netty learning notes netty source code - accept and read process
preface
The notes are based on black horse's Netty teaching handout and some of my own understanding. I feel that this is a very good video I've seen. There's basically no nonsense. Video address: Black horse Netty . Here is.
Or this Code:
public class TestSourceServer {
public static void main(String[] args) {
new ServerB ...
Added by henryblake1979 on Mon, 31 Jan 2022 08:46:15 +0200
3hutool source code analysis: dateutil (time tool class) - obtain various contents of the date
Technical work should be rewarded
follow+Click three times (like, comment, collect) and watch again to form a good habit
Before reading this article, I suggest you have a certain understanding of the date and time of the java source code. If you don't know, you can read this article first:
Wanzi blog teaches you to understand the date and t ...
Added by RogerInHawaii on Fri, 14 Jan 2022 00:57:32 +0200
Suricata6.0 flow table management source code note 7: flow aging 03
The flow aging entry function FlowManager checks the aging process. If it enters the emergency mode, it directly calls the function FlowTimeoutHash for aging processing. If it is in the normal mode, it calls the function FlowTimeoutHashInChunks for aging processing.
1. FlowTimeoutHashInChunks function
FlowManager->FlowTimeoutHashInChunks
...
Added by sickness01 on Sun, 09 Jan 2022 05:22:13 +0200
Suricata6.0 flow table management source code note 4: flow establishment 02
This article continues to explain the establishment of flow in the previous article. The most important function FlowGetNew is to obtain a flow. The acquisition process is also very tortuous. Please tell your grandparents to get a flow.
1. The function flowgetnew can also be understood in several aspects:
FlowHandlePacket->FlowGetFlowFromH ...
Added by makka on Sat, 08 Jan 2022 13:30:54 +0200
Spring source code parsing -- spring web Filter parsing
brief introduction
In the last few articles, we explored the code related to request processing. This article begins to explore some operation codes before request processing, such as Filter. This article explores Filter initialization, request processing and other related codes.
preface
First, simply define the relevant test code:
Startup ...
Added by jsimmons on Sun, 02 Jan 2022 12:31:55 +0200
RestTemplate source code analysis
I believe RestTemplate is the most used http client in SpringBoot. Let's analyze its source code today.
1, Simplest usage
First, you need to inject the Bean instance of RestTemplate into the container
@Configuration
public class RestTemplateConfig {
@Bean
public RestTemplate getRestTemplate() {
return new RestTemplate();
...
Added by poleposters on Wed, 29 Dec 2021 14:11:42 +0200
Chapter 04 core process of Nacos Client service subscription mechanism
Learning is not so utilitarian. The second senior brother will take you to easily read the source code from a higher dimension ~
Speaking of the service subscription mechanism of Nacos, friends who don't know about it may feel very mysterious. This article will let you understand the subscription implementation of Nacos 2.0 client in simple ...
Added by rline101 on Fri, 24 Dec 2021 22:22:16 +0200