Deep Interpretation of Java Thread Pool Design Ideas and Source Code Implementation

I believe everyone has read a lot of articles about thread pools, which are also necessary for interviews. If you still know a little after reading a lot of articles, I hope this article can really help you master Java thread pools. A major focus of this article is source code parsing, with a small amount of space to introduce thread pool desig ...

Posted by esscher on Sat, 23 Nov 2019 22:08:30 -0800

Asynchronous programming with completable future

A scenario will be encountered in the development, as follows Object result1 = service1.func1();//Implementation 80 ms Object result2 =service2.func2();//Implementation 50 ms service3.func3(result1,result2); func3() needs to wait for func1 and func2 to execute. If func1 and func2 can be executed at the same time, the minimum waiting ...

Posted by david-remone123 on Wed, 20 Nov 2019 07:43:57 -0800

HashMap Source Learning

common method put method Description: One of the most common methods used to add key-value pairs to a hash bucket. However, this method does not perform the actual operation. Instead, it delegates the putVal method to process Code: public V put(K key, V value) { // This call specifies hash,key,value, replace existing value, not create mode ...

Posted by Jaquio on Tue, 19 Nov 2019 22:42:33 -0800

Reentrantlock details

Reprint link: https://www.cnblogs.com/takumicx/p/9338983.html About ReentrantLock The implementation of exclusive lock in jdk can use ReentrantLock in addition to the keyword synchronized. Although there is no difference between ReentrantLock and synchronized in performance, ReentrantLock has more functions, is more flexible in use, and is more ...

Posted by haku87 on Tue, 19 Nov 2019 08:36:01 -0800

ForkJoinPool source code analysis (unfinished, to be added)

Catalog Introduction to ForkJoinPool What is ForkJoinPool? What are the advantages and disadvantages of ThreadPoolExecutor? When to use the ForkJoinPool? Example DEMO Involving core classes or components ForkJoinPool ForkJoinTask ForkJoinWorkerThread WorkQueue Execution process Execution process Task stealing Source code analysis Add ...

Posted by bimo on Tue, 19 Nov 2019 03:50:34 -0800

cocoapods installation errors and Solutions

Error in updating pod rubygems/core_ext/kernel_warn /Users/joanfen/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rubygems/core_ext/kernel_warn (LoadError) from /Users/joanfen/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55: ...

Posted by xcoderx on Mon, 18 Nov 2019 06:09:04 -0800

V. agency mode

proxy pattern Definition Provides a proxy for other objects to control access to this object. Why use agent mode? Mediation isolation: in some cases, a client class does not want or can not directly reference a delegate object, while a proxy class object can mediate between the client class and the delegate object, which is characterized by t ...

Posted by Tilemachos on Mon, 18 Nov 2019 05:43:40 -0800

Tomcat service installation - follow up (easy to do)

Tomcat introduction 1. Free and open source Web application server2. A core project in the Jakarta project of the Apache Software Foundation3. Jointly developed by Apache, Sun and some companies and individuals4. Loved by Java enthusiasts and recognized by some software developers5. Currently popular Web application server Tomcat core componen ...

Posted by Hybride on Mon, 18 Nov 2019 01:13:57 -0800

Spring Boot source code analysis -- essence of Spring Boot: initialization data at startup

When we use spring boot to build a project, we sometimes encounter the need to initialize some operations when the project starts. For this demand, spring boot provides us with the following solutions for us to choose: ApplicationRunner and CommandLineRunner interfaces InitializingBean interface and @ PostConstruct during Spring container i ...

Posted by serg91 on Sun, 17 Nov 2019 19:44:30 -0800

Thread processing two or three things

[mandatory] thread pools are not allowed to be created by Executors, but by ThreadPoolExecutor. Such a processing method enables the students who write to be more clear about the running rules of thread pools and avoid the risk of resource exhaustion. The above is the mandatory provision on concurrency in the java Development Manual of Alibaba. ...

Posted by noobcody on Wed, 13 Nov 2019 00:12:45 -0800