René's URL Explorer Experiment


Title: JavaGuide/docs/java/concurrent/java-lock.md at main · Snailclimb/JavaGuide · GitHub

Open Graph Title: JavaGuide/docs/java/concurrent/java-lock.md at main · Snailclimb/JavaGuide

X Title: JavaGuide/docs/java/concurrent/java-lock.md at main · Snailclimb/JavaGuide

Description: Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发 - JavaGuide/docs/java/concurrent/java-lock.md at main · Snailclimb/JavaGuide

Open Graph Description: Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发 - Snailclimb/JavaGuide

X Description: Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发 - Snailclimb/JavaGuide

Opengraph URL: https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/blob/*name(/*path)
route-controllerblob
route-actionshow
fetch-noncev2:8721713a-0670-1851-f0bc-7e83a0298fa0
current-catalog-service-hashf3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb
request-idD7B0:134698:9BB01A:D3A906:6A520198
html-safe-nonceee688a4128cf69333c90c24b4333436259eff8805aa90be91faf66fdbc5b3dc8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0IwOjEzNDY5ODo5QkIwMUE6RDNBOTA2OjZBNTIwMTk4IiwidmlzaXRvcl9pZCI6IjYyMzAwMjc5NzUwNjIwNjE0NjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf5d12efb9934251f74ff0bef1507f43887e07579507b999bbda325835959bcd6
hovercard-subject-tagrepository:132464395
github-keyboard-shortcutsrepository,source-code,file-tree,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///blob/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md
twitter:imagehttps://opengraph.githubassets.com/30c107aa6535b48345a727653cb4cf45a22de6f7626d2668592204673a17b804/Snailclimb/JavaGuide
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/30c107aa6535b48345a727653cb4cf45a22de6f7626d2668592204673a17b804/Snailclimb/JavaGuide
og:image:altJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发 - Snailclimb/JavaGuide
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-cache
go-importgithub.com/Snailclimb/JavaGuide git https://github.com/Snailclimb/JavaGuide.git
octolytics-dimension-user_id29880145
octolytics-dimension-user_loginSnailclimb
octolytics-dimension-repository_id132464395
octolytics-dimension-repository_nwoSnailclimb/JavaGuide
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id132464395
octolytics-dimension-repository_network_root_nwoSnailclimb/JavaGuide
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7aed05249554b889eb33d002851a973eebcc7e91
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FSnailclimb%2FJavaGuide%2Fblob%2Fmain%2Fdocs%2Fjava%2Fconcurrent%2Fjava-lock.md
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FSnailclimb%2FJavaGuide%2Fblob%2Fmain%2Fdocs%2Fjava%2Fconcurrent%2Fjava-lock.md
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fblob%2Fshow&source=header-repo&source_repo=Snailclimb%2FJavaGuide
Reloadhttps://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md
Reloadhttps://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md
Reloadhttps://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md
Snailclimb https://github.com/Snailclimb
JavaGuidehttps://github.com/Snailclimb/JavaGuide
Notifications https://github.com/login?return_to=%2FSnailclimb%2FJavaGuide
Fork 46.2k https://github.com/login?return_to=%2FSnailclimb%2FJavaGuide
Star 157k https://github.com/login?return_to=%2FSnailclimb%2FJavaGuide
Code https://github.com/Snailclimb/JavaGuide
Issues 57 https://github.com/Snailclimb/JavaGuide/issues
Pull requests 1 https://github.com/Snailclimb/JavaGuide/pulls
Discussions https://github.com/Snailclimb/JavaGuide/discussions
Actions https://github.com/Snailclimb/JavaGuide/actions
Projects https://github.com/Snailclimb/JavaGuide/projects
Security and quality 0 https://github.com/Snailclimb/JavaGuide/security
Insights https://github.com/Snailclimb/JavaGuide/pulse
Code https://github.com/Snailclimb/JavaGuide
Issues https://github.com/Snailclimb/JavaGuide/issues
Pull requests https://github.com/Snailclimb/JavaGuide/pulls
Discussions https://github.com/Snailclimb/JavaGuide/discussions
Actions https://github.com/Snailclimb/JavaGuide/actions
Projects https://github.com/Snailclimb/JavaGuide/projects
Security and quality https://github.com/Snailclimb/JavaGuide/security
Insights https://github.com/Snailclimb/JavaGuide/pulse
https://github.com/Snailclimb/JavaGuide
JavaGuidehttps://github.com/Snailclimb/JavaGuide/tree/main
docshttps://github.com/Snailclimb/JavaGuide/tree/main/docs
javahttps://github.com/Snailclimb/JavaGuide/tree/main/docs/java
concurrenthttps://github.com/Snailclimb/JavaGuide/tree/main/docs/java/concurrent
Historyhttps://github.com/Snailclimb/JavaGuide/commits/main/docs/java/concurrent/java-lock.md
https://github.com/Snailclimb/JavaGuide/commits/main/docs/java/concurrent/java-lock.md
JavaGuidehttps://github.com/Snailclimb/JavaGuide/tree/main
docshttps://github.com/Snailclimb/JavaGuide/tree/main/docs
javahttps://github.com/Snailclimb/JavaGuide/tree/main/docs/java
concurrenthttps://github.com/Snailclimb/JavaGuide/tree/main/docs/java/concurrent
Rawhttps://github.com/Snailclimb/JavaGuide/raw/refs/heads/main/docs/java/concurrent/java-lock.md
乐观锁和悲观锁详解https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/optimistic-lock-and-pessimistic-lock.md
CAS 详解https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/cas.md
https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#一把锁到底保护什么
https://camo.githubusercontent.com/e0ba3fdaec9080bce6f1000c4147c4277b1cc755ccbd3f22d033689d9633115a/68747470733a2f2f6f73732e6a61766167756964652e636e2f6769746875622f6a61766167756964652f63732d6261736963732f6f7065726174696e672d73797374656d2f6f732d6c6f636b2d637269746963616c2d73656374696f6e2e706e67
https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#互斥锁同一时刻只允许一个线程进入
https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#读写锁读读共享写操作独占
https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#自旋锁不阻塞先原地等一会儿
https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#悲观锁乐观锁和-cas-的位置
乐观锁和悲观锁详解https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/optimistic-lock-and-pessimistic-lock.md
CAS 详解https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/cas.md
Atomic 原子类总结https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/atomic-classes.md
https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#synchronized-的底层monitor字节码和内存语义
https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#synchronized-锁优化别把锁升级背成固定口诀
https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#reentrantlockcondition-和-aqs-怎么接上
AQS 详解https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/aqs.md
从ReentrantLock的实现看AQS的原理及应用https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/reentrantlock.md
https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#java-锁该怎么选
https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#常见坑
死锁详解https://github.com/Snailclimb/JavaGuide/blob/main/docs/cs-basics/operating-system/dead-lock.md
https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#总结
https://github.com/Snailclimb/JavaGuide/blob/main/docs/java/concurrent/java-lock.md#参考资料
The Java Language Specification, Chapter 17. Threads and Lockshttps://docs.oracle.com/javase/specs/jls/se24/html/jls-17.html
The Java Virtual Machine Specification, monitorenterhttps://docs.oracle.com/javase/specs/jvms/se24/html/jvms-6.html#jvms-6.5.monitorenter
Oracle Java API: Lockhttps://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/Lock.html
Oracle Java API: ReentrantLockhttps://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/ReentrantLock.html
Oracle Java API: StampedLockhttps://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/StampedLock.html
OpenJDK JEP 374: Deprecate and Disable Biased Lockinghttps://openjdk.org/jeps/374
OpenJDK JEP 491: Synchronize Virtual Threads without Pinninghttps://openjdk.org/jeps/491
OSTEP 中文版:Lockshttps://pages.cs.wisc.edu/~remzi/OSTEP/Chinese/28.pdf
MIT 6.005: Locks and Synchronizationhttp://web.mit.edu/6.005/www/fa15/classes/23-locks/
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.