AQS for java Concurrent Programming learning
principle
The full name is AbstractQueuedSynchronizer. When a thread goes to get resources, it will judge whether there is a lock according to the state value state. If there is a lock, it will be added to the linked list. The thread in the linked list will determine whether the resources have been released by spinning. If it is released, it wi ...
Posted by billf on Thu, 17 Oct 2019 14:27:44 -0700
Flutter App software debugging guide
Preface
Recommend: Android learning PDF + Architecture Video + interview document + source notes
In the actual development, the proportion of testing and debugging time is relatively high in the total development time. When repairing product defects, we usually need to observe the value of an object in real time. Although output can be in the f ...
Posted by mikemike on Thu, 17 Oct 2019 06:05:26 -0700
fastDFS introduction
FastDFS is an open-source lightweight distributed file system, which manages files. Its functions include file storage, file synchronization, file access (file upload, file download), etc. It solves the problems of mass storage and load balancing. FastDFS is especially suitable for online services with file as the carrier, multi picture, multi ...
Posted by janderson on Wed, 16 Oct 2019 19:57:20 -0700
On the learning of java Concurrent Programming
I talked about AQS before. Source code of exclusive lock , here, let's talk about the implementation of another lock, shared lock, to CountDownLatch For example.
Source code analysis
Construction method
The Sync method is an internal method, just like ReentrantLock before. The constructor needs to pass in an integer no less than 0 to assign to ...
Posted by benyboi on Wed, 16 Oct 2019 14:30:57 -0700
A collection of various derivations
A collection of various derivations
Derivation formula
We've learned the simplest list derivation and generator expressions before. But in addition, there are dictionary derivation, set derivation and so on.
The following is a detailed derivation format with list derivation as an example, which is also applicable to othe ...
Posted by jiggens on Wed, 16 Oct 2019 12:59:42 -0700
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
Function knowledge points of JS
I. defining functions
1. Function declaration method
function sum(a, b) {
console.log(1+3);
}
sum(10, 20);
2. Functional expression
var add = function () {
console.log(1+3);
};
add();
3. Use Function constructor
var add2 = new Function('console.log(1+3);');
add2();
...
Posted by sathyan on Tue, 15 Oct 2019 13:05:04 -0700
Python multitasking protocol
Preface
The core point of the collaboration is the use of the collaboration, that is, you only need to know how to use the collaboration; but if you want to know how to achieve the collaboration, you need to know the iterator, the generator in turn.
If you only want to see the use of the coordinator, you just need to look at the first part; i ...
Posted by Kitkat on Mon, 14 Oct 2019 23:48:58 -0700
[BZOJ3295][Cqoi 2011] Dynamic Inverse Sequence Pairs
[BZOJ3295][Cqoi 2011] Dynamic Inverse Sequence Pairs
Tree nest tree | | CDQ divide and conquer
I feel that the tree cover tree is better to think about. It can be reduced without thinking. However, my tree cover tree was hit several months ago, and it has not been transferred yet.
CDQ is good tune, but the idea is not good. We regard deletio ...
Posted by a6000000 on Mon, 14 Oct 2019 13:02:38 -0700