当前位置:网站首页>synchronized 详细解析
synchronized 详细解析
2022-06-09 05:30:00 【猫猫大神】
1.大家都知道我们写的代码都会经过编译给jvm管理,那怎么管理呢?肯定是需要加一些东西的
这个东西就是对象头,标注一些东西 ,比如今天说的锁,还有gc相关东西 如下图

2.jvm 怎么写的
省略。。。不想找了。。。(后面估计我也记不住)
3.synchronized 锁有升级的过程,从无锁--》偏向锁--》轻量级锁---》重量级锁,根据上面的流程 总结下流程
3.1)偏向锁流程


3.2)轻量级锁



3.3)重量级锁
加锁流程


退出流程

边栏推荐
- Alibaba cloud AI training camp - SQL basics 4: set operation - addition and subtraction of tables, join, etc
- 优视慕V8投影仪,打开高清新“视”界
- Alibaba cloud AI training camp -sql basics 6: test questions
- An article takes you to know what token is
- Number that appears only once -leetcode
- Cuijian hasn't changed. BAIC Jihu should make a change
- 好榛子出辽阳!
- Mysql5.7 one master multi slave configuration
- 和琪宝的重庆之旅~
- Lucene构建索引与执行搜索小记
猜你喜欢

Apache devlake code base guide

Windows uses php to start ThinkPHP project and deploy configuration

1- enter the database

Product weekly report issue 29 | creation center optimization: the sending assistant adds the quality score detection function, and the blog adds the historical version of the content

AI video cloud: a good wife in the era of we media

Windows10 installs both MySQL 5 and MySQL 8

Heqibao's trip to Chongqing ~

The 27th issue of product weekly report | members' new interests of black users; CSDN app v5.1.0 release

Mysql5.7 one master multi slave configuration

Differences between tinyint and int
随机推荐
redis 缓存雪崩、穿透、击穿问题
[it] Foxit PDF retention tool selection
Article title
2021 national vocational skills competition Liaoning "Cyberspace Security Competition" and its analysis (ultra detailed)
Heqibao's trip to Chongqing ~
FPGA based TDC Research Report
Mysql5.7 one master multi slave configuration
MySQL one master multi slave configuration centos7 pro test
内网渗透 - 哈希传递攻击
Gstreamer应用开发实战指南(四)
Alibaba cloud AI training camp - machine learning 3:lightgbm
CSV file reading (V3 & V5)
和琪宝的重庆之旅~
AQS 之 CyclicBarrier 源码分析
Matlab - polynomial and function
Differences between tinyint and int
Lucene构建索引与执行搜索小记
matlab----多项式、函数
Apache Devlake 代码库导览
Design owlook network novel recommendation system