当前位置:网站首页>Parsing of thread safe classes: (2.8-3.6)
Parsing of thread safe classes: (2.8-3.6)
2022-04-22 05:16:00 【Look, water is water】
Thread safe classes are generally embodied in the process of multithreading concurrency , There are mainly five kinds of : immutable , Absolutely safe class , Relatively safe classes , Thread compatibility , Thread opposition ;
immutable :
By final Modified class ;
String Type of ;
Enumeration type , Such as : public Enum Color{RED,GREEN};
Floating point references wrap exact types and large values : BigInteger,BigDecimal;
Absolutely safe class :
Is to add... Again on the relatively safe class synchronized keyword , such as vector Add it to the front and it becomes an absolutely safe class ;
Relatively safe classes :
vector and hashtable When you have a layer of synchronized Class ;
Thread compatibility :
image ArrayList and HashMap Itself is not safe , It can be preceded by synchronized You can synchronize secure classes ;
Thread opposition :
thread The following two classes suspend and resume, Has now been abandoned , Like threads A Hold lock C perform suspend After suspending the operation , Threads B Lock required C can resume Wake up the way , Wake up the
Threads A; The thread B Will always be in a waiting state, forming a deadlock , So he was abandoned ;
版权声明
本文为[Look, water is water]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210626122083.html
边栏推荐
- Considerations for importing idea package and calling its methods
- Unity中的UGUI源码解析之事件系统(9)-输入模块(下)
- Go语言爬虫基础
- PyTorch搭建双向LSTM实现时间序列预测(负荷预测)
- scanf、printf的输入输出(格式控制符)
- Dynamic programming -- lc474 One and zero
- Leetcode 1423. Maximum points you can obtain from cards
- Request and response objects
- What is an iterator
- Pydeck enables efficient visual rendering of millions of data points
猜你喜欢

MySQL数据库第十一次

Enum enumeration type

Chapter IV constraints and indexes

Data distribution, correlation analysis and visualization method of data exploratory analysis (EDA)

What kind of programming language is this to insert into the database

Visio setting network topology

Chapter 7 select clause and sub query

数据库(二)MySQL表的增删改查(基础)

Typescript function generics

How to initiate mqtt 100 million connection and 10 million message throughput performance test
随机推荐
[matlab] draw Zernike polynomials
Summary of common methods, advantages and disadvantages of robot UAV visual obstacle avoidance
Pydeck enables efficient visual rendering of millions of data points
Detailed explanation of Neptune w800 lighting (interruption) project
Reduce the graduation time to before the age of 20, and go to primary school for five years at the age of 5, so as to increase the population
Regular expression of shell script
防抖函数和节流函数
Request and response objects
Summary of 2019 personal collection Framework Library
MySQL数据库第十一次
Chapter IX user and authority
Dynamic programming -- lc474 One and zero
Layer 3 switch [vlanif details] enable OSPF and router interworking [ENSP implementation]
Chapter VIII affairs
什么是幂等性
数据库(二)MySQL表的增删改查(基础)
Chapter 7 select clause and sub query
TDD development mode and DDD development mode
What is idempotency
Enum enumeration type