java read / write lock ReentrantReadWriteLock

summary When we introduced AQS, they were basically exclusive locks (mutual exclusion locks). These locks only allowed one thread to access at the same time, while read-write locks allowed multiple threads to access at the same time. When the read operation is much higher than the write operation, the read-write lock is used to make the read- ...

Added by chowwiie on Wed, 26 Jan 2022 10:40:24 +0200

C language: array

Array: An array composed of several related data items of the same type, which are stored together in order; An array is actually a collection of ordered data of the same type. Array name: Use a unified name to identify this group of data. This name is the array name. Array elements: Each data item that constitutes an array is called an element ...

Added by owaring on Wed, 26 Jan 2022 08:40:12 +0200

RocketMQ4.9.1 source code analysis - (HA module) Master Slave Slave report and message processing

Then the last one RocketMQv4.9.1 source code analysis - HA Master-slave Master reading and writing processing After answering the questions related to Master, this article continues to look at the code around some questions related to Slave. For slave, we have the following doubts: How can slave obtain the routing information of the masterH ...

Added by john_bboy7 on Wed, 26 Jan 2022 07:44:04 +0200

Even some people think that Redis is only as simple as get set?!

Five data types and application scenarios of Redis Redis has five data types, namely, string,list,hash,set,zset(sort set). I think this point should be clear to all partners who have a little knowledge of redis. Next, let's discuss the application scenarios of these five data types. [get notes] string This type is believed to be the most fam ...

Added by kansaschuck on Wed, 26 Jan 2022 07:20:04 +0200

JAVA learning notes 2 array

Array An array is an ordered collection of data of the same typeThe array length is fixedArray can be any data type, including basic type and reference typeThe array object itself is in the heapThe subscript of the array starts from 0Array subscripts must be used within the specified range, otherwise an error is reported (subscript out of boun ...

Added by trehy2006 on Wed, 26 Jan 2022 06:37:34 +0200

CAS operation and underlying implementation of JUC concurrent programming

concept The full name of CAS is Compare And Swap, which means compare and exchange. It is the atomic operation of CPUCAS is an abstract idea, not a concrete implementationCAS operation has three parameters: memory address of the value to be modified, expected value and new valueThe main idea is to judge whether the value of a location in memor ...

Added by crash58 on Wed, 26 Jan 2022 06:06:35 +0200

Python automated office

1. Basic operation Get the current py file name import os file = 'test.py' fname = os.path.basename(file) print(fname) #Through the basename() method, we can remove the path and get only the file name #If the path fails to recognize the error (the problem of escape), add r before the path. (file = r'C:\Users\15205\PycharmProjects\pachon ...

Added by djg_uk on Wed, 26 Jan 2022 05:57:12 +0200

Some common features of C++11 (stability and compatibility)

Some common features of C++11 (stability and compatibility) 1, Original literal The literal quantity defining the original string is added in C++11. The definition method is: R "xxx (original string) xxx", in which the strings on both sides of () can be omitted. The original literal R can directly represent the actual meaning of the ...

Added by abhikerl on Wed, 26 Jan 2022 05:27:44 +0200

Deeply understand the communication between threads of concurrent programming

Deeply understand the communication between threads of concurrent programming 1, What is thread communication Communication between threads is to enable threads to send signals to each other. When multiple threads are processing the same resource and the tasks are different (normally, multi-threaded execution is processed at the same ti ...

Added by coily on Wed, 26 Jan 2022 03:42:53 +0200

python - piecemeal learning - flash - Introduction to making web pages 1

1. Introduction to flash Flash can be used for web development Install as pip install flask 2. Brief description of flash 1. Print helloworld on the page app=Flask is in fixed mode @app. The route ('/') decorator generates the main web page and executes the following functions of the decorator app.run() runs and starts the service fr ...

Added by kdoggy on Wed, 26 Jan 2022 02:16:17 +0200