Java thread basic operations

Implementation mode run method for implementing Runable interface public static class RunnableTask implements Runnable { // Note that the return type here is void, and the Runnable interface has no return value @Override public void run(){ // do something } public static void main(String[] argUTF-8...

Posted by onlinegs on Tue, 26 Oct 2021 14:09:14 +0530

Radiation mechanism in java

What is reflection? In the running state, for any class, you can get all the properties and methods of the class, and for any object, you can call any of its methods and properties (including private methods and properties). This dynamically obtained information and the function of dynamically UTF-8...

Posted by sheckel on Tue, 26 Oct 2021 14:16:46 +0530

Java review day23-2021/10/26

New features of jdk1.8 1, lambda expression of new features in jdk1.8 Let's look at a piece of code first, and then analyze the lambda expression @Test public void test1() { // Runnable interface is a functional interface. The most common instantiation method is anonymous implementation of clasUTF-8...

Posted by BigDaddy13 on Tue, 26 Oct 2021 16:59:13 +0530

Basic learning of Java Memory Model -- a simple talk about reordering

preface I learned the foundation of Java multithreading, but it is only the foundation of the foundation. If you want to systematically learn the relevant contents of Java high concurrency, there is still a long way to go. The following blogs will summarize the relevant contents of JMM, and theUTF-8...

Posted by aggrav8d on Tue, 26 Oct 2021 17:34:23 +0530

day12 argument higher order function iterator and generator

Iterators and generators for real parameter higher order functions The essence of function 1) A function is a variable To define a function in Python is actually to define a variable whose type is function, and the function name is the variable name Variable = lambda parameter list: return valuUTF-8...

Posted by dvayne on Tue, 26 Oct 2021 17:51:22 +0530

Thread pool and Lock interface

Thread Pool Fundamentals: When we need to use threads to perform tasks, we usually create threads by inheriting the Thread class or implementing the Runnable interface, and we have a problem: A single thread takes up about 1M of space, and excessive allocation of threads can cause memory overflUTF-8...

Posted by jmarais on Tue, 26 Oct 2021 21:58:19 +0530

7. Monitoring and Assignment of Services through zookeeper+dubbo

Preface Ahead concept What is rpc Many people think that rpc is a network protocol. In fact, this idea is very wrong. The author thinks that rpc Protocol should be a communication protocol style. It is not http, a transport layer protocol, but restful. As shown in the figure below, the request UTF-8...

Posted by RandomEngy on Tue, 26 Oct 2021 23:06:25 +0530

park method of LockSupport for concurrent programming and thread interrupt response

preface 1. How to understand the thread interrupt method, which means that the thread is interrupted? Can the current thread continue to execute? 2. There are several methods to judge whether a thread is interrupted. What is the difference between them? 3. What is the difference between park/uUTF-8...

Posted by oldschool on Wed, 27 Oct 2021 07:38:59 +0530

An article to understand the course of Spring AOP

Spring AOP overview Recently, when looking at the source code of seata, the api of spring aop can be seen everywhere. So while looking at seata, I summarized spring aop When using the Spring framework, we often need to deal with the two major features of Spring, IOC and AOP. We previously wrotUTF-8...

Posted by harshilshah on Wed, 27 Oct 2021 10:10:36 +0530

[C++] mutex mutex

Mutex mutex When multithreading accesses shared resources, it is necessary to do mutually exclusive processing in order to ensure the thread safety of resources. Mutex of C++11 is more convenient and flexible than pthread library to provide mutex. C++11 provides the following four semantic muteUTF-8...

Posted by kanch33 on Wed, 27 Oct 2021 11:18:40 +0530