How to use synchronized code block

What's the difference between having synchronized or not? What does synchronized lock as a pessimistic lock? In the previous two articles, we have known how to use synchronized and the content of lock (instance object and Class object), which has covered the basic content of this keyword. Today, I want to introduce another writing method, whi ...

Posted by Full-Demon on Mon, 27 Apr 2020 18:55:23 -0700

Detailed steps to use Alibaba big fish Java

Summary Alibaba greater (formerly Alibaba big fish) is a product of Alibaba communication, which integrates the communication capabilities of three major operators. Aligreater provides personalized services including SMS, voice, direct charging of traffic, private special line, shop mobile number, etc. Open SMS service Step 1: Step 2: ...

Posted by Agtronic on Mon, 27 Apr 2020 09:42:33 -0700

Introduction to the use of Redis--Jedis

1. Create project 1.1 creation steps 1.2 add pom dependency <dependencies> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.9.0</version> </dependency> <!--test--> <dep ...

Posted by premracer on Mon, 27 Apr 2020 07:14:31 -0700

Replacing JSON with MsgPack protocol in Phoenix WebSocket

Why MsgPack? MsgPack is lighter and less traffic than JSON MsgPack's own date time type (always UTC) MsgPack comes with binary data type (it's convenient to transfer a picture or something) MsgPack supports custom types The standards of MsgPack are open source and well documented Phoenix.Socket.Serializer module In the Phoenix framework, ther ...

Posted by shmoo525 on Mon, 27 Apr 2020 04:11:12 -0700

What does synchronized lock as a pessimistic lock?

Continue with synchronized, last article What's the difference between having synchronized or not? We have learned that synchronized is used when multiple threads compete for the same resource concurrently. In this article, we will learn what is locked by synchronized as a pessimistic lock? Lock instance object In the last article, we have cod ...

Posted by webent on Sun, 26 Apr 2020 19:29:15 -0700

Climbing pit of VUE project -- 3. Programmed navigation of vue route

1, Summary One sentence summary: router.push(location, onComplete?, onAbort?): router.push('home') Programming navigation In addition to using < router link > to create a tag to define the navigation link, we can also use router's instance method to implement it by writing code. #router.push(location, onComplete?, onAbort?) //St ...

Posted by rolajaz on Sun, 26 Apr 2020 18:34:22 -0700

A summary of three methods of grey level publishing implemented by Nginx

A summary of three methods of grey level publishing implemented by Nginx The main principle of gray-scale publishing is access routing control, and the key point is to ensure that each access is the same node. Mode 1: adjust the load balance weight Load balancing is based on the existing network structure, which provides a ...

Posted by lalabored on Sun, 26 Apr 2020 10:52:42 -0700

Performance comparison between wrapper class and basic type operation in Java (Integer i += 1)

This paper mainly introduces the influence of automatic unpacking and boxing on the performance of operation from the perspective of bytecode and memory occupation. If you want to understand bytecode, you need to understand the structure of JVM virtual machine stack and code execution process. Please refer to "deep understanding of Java vi ...

Posted by varghesedxb on Sat, 25 Apr 2020 23:48:36 -0700

From (Introduction to ES6 standard) (3rd Edition) (by Ruan Yifeng) classic case - in continuous update

From (Introduction to ES6 standard) (3rd Edition) (by Ruan Yifeng) classic case - in continuous update 1. An example of simulating the return value of next method function makeIterator(array){ var nextIndex = 0; return { next: function(){ return nextIndex < array.length ? {value: array[nextIndex++],done:false} : {value: und ...

Posted by demonicfoetus on Sat, 25 Apr 2020 21:04:40 -0700

Interceptor Based threadload auto Reclaimer

1, Scene The life cycle of the container t thread pool is different from that of the request, so the ThreadLocal parameter isolation of the request domain cannot be saved The request domain needs to reclaim ThreadLocal manually every time. The solution of custom thread pool will not be considered temporarily For classes with unsafe threads suc ...

Posted by karnetics on Sat, 25 Apr 2020 07:39:33 -0700