Explain java multithreading in simple terms (basic chapter)
1 basic concepts of process and thread
1.1 background of the process
The original computer can only accept some specific instructions. Every time a user inputs an instruction, the computer makes an operation. When the user is thinking or typing, the computer is waiting. This is very inefficient. In many cases, the computer is in a waiting sta ...
Posted by adam87 on Thu, 03 Feb 2022 15:05:17 +0100
Java multithreading -- Concurrent HashMap
In the previous article, I have published common interview questions. Here I spent some time sorting out the corresponding answers. Due to my limited personal ability, it may not be in place. If there are unreasonable answers, please give me some advice. Thank you here.
This paper mainly describes the concurrent HashMap, a high-frequency inter ...
Posted by claypots on Thu, 03 Feb 2022 01:37:13 +0100
Deep understanding of multithreading park and unpark
1. Background
The interviewer asked how to pause a thread
Tell me about your understanding of park
2. Code
package com.ldp.demo01;
import com.common.MyThreadUtil;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.locks.LockSupport;
/**
* @author Blog emperor posture
* @address https://www.cnblogs.com/newAndHui/
* @WeChat 8512 ...
Posted by GameMusic on Wed, 02 Feb 2022 22:32:40 +0100
[java learning path] 011 Thread pool
Thread pool
Why do I need a thread pool
In practical use, threads occupy resources very much, and poor management of them is easy to cause system problems. Therefore, in most concurrency frameworks, thread pools are used to manage threads
benefit
Using thread pool can reuse existing threads to continue executing tasks, avoiding the consumpt ...
Posted by AlanG on Wed, 02 Feb 2022 17:58:27 +0100
Processes and threads
Processes and threads
What are processes and threads? What is the difference between the two? How to implement threads? Methods commonly used in threads? What are the states in the thread? Thread scheduling problem? Thread safety issues? wait and notify methods in Object class? Producer and consumer model
Process and thread and their differen ...
Posted by xeirus on Wed, 02 Feb 2022 11:07:43 +0100
VIII IDEA usage and multithreading
1. Overview of advanced knowledge points (from Shang School Video)
Chapter 8 multithreadingChapter 9 common java classesChapter 10 enumeration classes and annotationsChapter 11 java collectionChapter 12 genericsChapter 13 IO flowChapter 14 network programmingChapter 15 java reflection mechanism (difficult)Chapter 16 other new features of Java ...
Posted by cmay4 on Wed, 02 Feb 2022 04:33:53 +0100
Optimistic lock and pessimistic lock
1. Optimistic lock
Optimistic lock assumes that the data will not generate concurrency conflict under normal circumstances, so when the data is submitted and updated, it will formally detect whether the data has concurrency conflict. If concurrency conflict is found, it will return the user's error information and let the user decide ho ...
Posted by viperfunk on Tue, 01 Feb 2022 22:23:39 +0100
Detailed explanation of Java thread pool parameters and other creation methods
With the increasing number of cpu cores, it is inevitable to use multithreading technology to make full use of its computing power. Therefore, multithreading technology is a technology that service developers must master. Thread creation and destruction involve system calls and consume system resources. Therefore, thread pool technology is intr ...
Posted by MCrosbie on Tue, 01 Feb 2022 19:09:16 +0100
Golang high concurrency processing model
Original link: https://mp.weixin.qq.com/s/ZqfN8UlWRpoGhznGH-L1mw
introduce
I came across an article written in 15 years. To be honest, the title really attracted me.
I won't translate this article directly. I put the original address at the end of the article.
The requirement of the project is very simple. The client sends the request and t ...
Posted by Anyaer on Tue, 01 Feb 2022 13:41:31 +0100
Introduction to JUC programming
preface:
In Java, the thread part is a key point. The JUC mentioned in this article is also about threads. JUC is Java util . Short for concurrent toolkit. This is a toolkit for processing threads. JDK 1.5 began to appear. Let's see how it works.
1, volatile keyword and memory visibility
1. Memory visibility: Let's take a look at the followi ...
Posted by RaheimSG on Tue, 01 Feb 2022 09:33:03 +0100