Chapter III Analysis of ThreadLocalRandom principle

ThreadLocalRandom class is jdk7 a new Random number generator under JUC package, which makes up for the defect of Random class in multithreading. 1. Random class and its limitations 1.1 brief analysis of random class source code Generating a new random number requires two steps First, generate a new seed nextseed=f(oldseed) (1) from th ...

Posted on Wed, 22 Sep 2021 08:46:37 -0400 by murdocsvan

Combined with JDK8 source code, this paper deeply analyzes the implementation principle of AQS and ReentrantLock

preface This article belongs to the column "100 problems to solve Java concurrency". This column is original by the author. Please indicate the source of quotation. Please help point out the deficiencies and errors in the comment area. Thank you! Please refer to table of contents and references for this column 100 problems to sol ...

Posted on Mon, 20 Sep 2021 01:53:41 -0400 by wizardry

Explanation of Reactor model

1, What is the Reactor model          Reactor pattern is a method to process concurrent service requests and submit the requests to one or more servers An event design pattern for multiple service handlers. When the client requests arrive, the service handler uses the multi-channel allocation strategy. A ...

Posted on Tue, 14 Sep 2021 00:58:09 -0400 by woobarb

How threads are created

Thread We start a Thread by creating a subclass of new Thread and calling its start method public class MyThread extends Thread { @Override public void run() { ... } } public static void main(String[] args) { new MyThread().start(); } Question: why is the start method called instead of the run method 1. When a new ...

Posted on Sun, 12 Sep 2021 21:59:59 -0400 by Daggeth

Black Horse-Concurrent Programming Learning

1. View Process Kill Process ps -fe | grep java Or use jps Top-H-p pid to see how internal threads of the process represented by pid are running You can also view the thread information of a process using jstack pid Using jconsole, you can also view thread information for a process (graphical interface) 2. Reasons for thread switching Time sli ...

Posted on Sat, 11 Sep 2021 14:04:12 -0400 by burningkamikaze