René's URL Explorer Experiment


Title: JavaInterview/多线程.md at main · Growing111/JavaInterview · GitHub

Open Graph Title: JavaInterview/多线程.md at main · Growing111/JavaInterview

X Title: JavaInterview/多线程.md at main · Growing111/JavaInterview

Description: 全网最齐全的Java面试题库-附答案-持续更新. Contribute to Growing111/JavaInterview development by creating an account on GitHub.

Open Graph Description: 全网最齐全的Java面试题库-附答案-持续更新. Contribute to Growing111/JavaInterview development by creating an account on GitHub.

X Description: 全网最齐全的Java面试题库-附答案-持续更新. Contribute to Growing111/JavaInterview development by creating an account on GitHub.

Opengraph URL: https://github.com/Growing111/JavaInterview/blob/main/多线程.md

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/blob/*name(/*path)
route-controllerblob
route-actionshow
fetch-noncev2:7fb62b44-d738-7d49-4d08-777a469f7f0c
current-catalog-service-hashf3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb
request-idC7DA:30DA77:296FC94:3749C35:6A655E0D
html-safe-nonce6ad432c254f144306b7e5415485236513ec9e8280b6c2dbc2795aba8cfd74fab
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0RBOjMwREE3NzoyOTZGQzk0OjM3NDlDMzU6NkE2NTVFMEQiLCJ2aXNpdG9yX2lkIjoiNzQ2MzgwMjA2NzIxODY4NTQ1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac4380831577a574c7ee7940245384deb0164e519afda4723a695b1d8125d0ef92
hovercard-subject-tagrepository:351407093
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/Growing111/JavaInterview/blob/main/多线程.md
twitter:imagehttps://opengraph.githubassets.com/e43d3810090fcc7fc9f1878f2666a9d1c679956077003e51e511fc183e409ad4/Growing111/JavaInterview
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e43d3810090fcc7fc9f1878f2666a9d1c679956077003e51e511fc183e409ad4/Growing111/JavaInterview
og:image:alt全网最齐全的Java面试题库-附答案-持续更新. Contribute to Growing111/JavaInterview development by creating an account on GitHub.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None52c76df668885aaff23b50bdca1fa1ea44ac9c1553e888ebc70ff1e4daa4625b
turbo-cache-controlno-cache
go-importgithub.com/Growing111/JavaInterview git https://github.com/Growing111/JavaInterview.git
octolytics-dimension-user_id23252580
octolytics-dimension-user_loginGrowing111
octolytics-dimension-repository_id351407093
octolytics-dimension-repository_nwoGrowing111/JavaInterview
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id336993047
octolytics-dimension-repository_parent_nwoWebInterviewHub/JavaInterview
octolytics-dimension-repository_network_root_id336993047
octolytics-dimension-repository_network_root_nwoWebInterviewHub/JavaInterview
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
release309153364422b3c499922d1a2a6404910a58ed8e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/Growing111/JavaInterview/blob/main/多线程.md#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FGrowing111%2FJavaInterview%2Fblob%2Fmain%2F%25E5%25A4%259A%25E7%25BA%25BF%25E7%25A8%258B.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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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%2FGrowing111%2FJavaInterview%2Fblob%2Fmain%2F%25E5%25A4%259A%25E7%25BA%25BF%25E7%25A8%258B.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=Growing111%2FJavaInterview
Reloadhttps://github.com/Growing111/JavaInterview/blob/main/多线程.md
Reloadhttps://github.com/Growing111/JavaInterview/blob/main/多线程.md
Reloadhttps://github.com/Growing111/JavaInterview/blob/main/多线程.md
Growing111 https://github.com/Growing111
JavaInterviewhttps://github.com/Growing111/JavaInterview
WebInterviewHub/JavaInterviewhttps://github.com/WebInterviewHub/JavaInterview
Notifications https://github.com/login?return_to=%2FGrowing111%2FJavaInterview
Fork 0 https://github.com/login?return_to=%2FGrowing111%2FJavaInterview
Star 0 https://github.com/login?return_to=%2FGrowing111%2FJavaInterview
Code https://github.com/Growing111/JavaInterview
Pull requests 0 https://github.com/Growing111/JavaInterview/pulls
Actions https://github.com/Growing111/JavaInterview/actions
Projects https://github.com/Growing111/JavaInterview/projects
Security and quality 0 https://github.com/Growing111/JavaInterview/security
Insights https://github.com/Growing111/JavaInterview/pulse
Code https://github.com/Growing111/JavaInterview
Pull requests https://github.com/Growing111/JavaInterview/pulls
Actions https://github.com/Growing111/JavaInterview/actions
Projects https://github.com/Growing111/JavaInterview/projects
Security and quality https://github.com/Growing111/JavaInterview/security
Insights https://github.com/Growing111/JavaInterview/pulse
https://github.com/Growing111/JavaInterview
JavaInterviewhttps://github.com/Growing111/JavaInterview/tree/main
Historyhttps://github.com/Growing111/JavaInterview/commits/main/%E5%A4%9A%E7%BA%BF%E7%A8%8B.md
https://github.com/Growing111/JavaInterview/commits/main/%E5%A4%9A%E7%BA%BF%E7%A8%8B.md
JavaInterviewhttps://github.com/Growing111/JavaInterview/tree/main
Rawhttps://github.com/Growing111/JavaInterview/raw/refs/heads/main/%E5%A4%9A%E7%BA%BF%E7%A8%8B.md
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#多线程
1.说说synchronized的实现原理https://github.com/Growing111/JavaInterview/blob/main/多线程.md#1%E8%AF%B4%E8%AF%B4synchronized%E7%9A%84%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86
2.ReentrantLock与synchronized的区别https://github.com/Growing111/JavaInterview/blob/main/多线程.md#2reentrantlock%E4%B8%8Esynchronized%E7%9A%84%E5%8C%BA%E5%88%AB
3.ReentrantLock实现原理https://github.com/Growing111/JavaInterview/blob/main/多线程.md#3reentrantlock%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86
4.Java原子类AtomicInteger实现原理https://github.com/Growing111/JavaInterview/blob/main/多线程.md#4java%E5%8E%9F%E5%AD%90%E7%B1%BBatomicinteger%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86
5.Java线程池实现原理https://github.com/Growing111/JavaInterview/blob/main/多线程.md#5java%E7%BA%BF%E7%A8%8B%E6%B1%A0%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86
6.ThreadLocal实现原理https://github.com/Growing111/JavaInterview/blob/main/多线程.md#6threadlocal%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86
7.InheritableThreadLocal原理知道吗?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#7inheritablethreadlocal%E5%8E%9F%E7%90%86%E7%9F%A5%E9%81%93%E5%90%97
8.说一下synchronized锁升级过程https://github.com/Growing111/JavaInterview/blob/main/多线程.md#8%E8%AF%B4%E4%B8%80%E4%B8%8Bsynchronized%E9%94%81%E5%8D%87%E7%BA%A7%E8%BF%87%E7%A8%8B
9.了解过什么是“伪共享”吗?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#9%E4%BA%86%E8%A7%A3%E8%BF%87%E4%BB%80%E4%B9%88%E6%98%AF%E4%BC%AA%E5%85%B1%E4%BA%AB%E5%90%97
10.“伪共享”出现的原因是什么?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#10%E4%BC%AA%E5%85%B1%E4%BA%AB%E5%87%BA%E7%8E%B0%E7%9A%84%E5%8E%9F%E5%9B%A0%E6%98%AF%E4%BB%80%E4%B9%88
11.如何避免“伪共享”?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#11%E5%A6%82%E4%BD%95%E9%81%BF%E5%85%8D%E4%BC%AA%E5%85%B1%E4%BA%AB
12.Java里的线程有哪些状态?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#12java%E9%87%8C%E7%9A%84%E7%BA%BF%E7%A8%8B%E6%9C%89%E5%93%AA%E4%BA%9B%E7%8A%B6%E6%80%81
13.什么是悲观锁?什么是乐观锁?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#13%E4%BB%80%E4%B9%88%E6%98%AF%E6%82%B2%E8%A7%82%E9%94%81%E4%BB%80%E4%B9%88%E6%98%AF%E4%B9%90%E8%A7%82%E9%94%81
14.怎么停止一个运行中的线程?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#14%E6%80%8E%E4%B9%88%E5%81%9C%E6%AD%A2%E4%B8%80%E4%B8%AA%E8%BF%90%E8%A1%8C%E4%B8%AD%E7%9A%84%E7%BA%BF%E7%A8%8B
15.说一下你对volatile的理解?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#15%E8%AF%B4%E4%B8%80%E4%B8%8B%E4%BD%A0%E5%AF%B9volatile%E7%9A%84%E7%90%86%E8%A7%A3
16.并发编程三要素?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#16%E5%B9%B6%E5%8F%91%E7%BC%96%E7%A8%8B%E4%B8%89%E8%A6%81%E7%B4%A0
17.创建线程有哪些方式?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#17%E5%88%9B%E5%BB%BA%E7%BA%BF%E7%A8%8B%E6%9C%89%E5%93%AA%E4%BA%9B%E6%96%B9%E5%BC%8F
18.线程池的优点?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#18%E7%BA%BF%E7%A8%8B%E6%B1%A0%E7%9A%84%E4%BC%98%E7%82%B9
19.CyclicBarrier和CountDownLatch的区别https://github.com/Growing111/JavaInterview/blob/main/多线程.md#19cyclicbarrier%E5%92%8Ccountdownlatch%E7%9A%84%E5%8C%BA%E5%88%AB
20.什么是CAS?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#20%E4%BB%80%E4%B9%88%E6%98%AFcas
21.CAS的问题https://github.com/Growing111/JavaInterview/blob/main/多线程.md#21cas%E7%9A%84%E9%97%AE%E9%A2%98
22.什么是AQS?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#22%E4%BB%80%E4%B9%88%E6%98%AFaqs
23.AQS支持几种同步方式?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#23aqs%E6%94%AF%E6%8C%81%E5%87%A0%E7%A7%8D%E5%90%8C%E6%AD%A5%E6%96%B9%E5%BC%8F
24.什么是自旋锁?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#24%E4%BB%80%E4%B9%88%E6%98%AF%E8%87%AA%E6%97%8B%E9%94%81
25.什么是多线程的上下文切换?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#25%E4%BB%80%E4%B9%88%E6%98%AF%E5%A4%9A%E7%BA%BF%E7%A8%8B%E7%9A%84%E4%B8%8A%E4%B8%8B%E6%96%87%E5%88%87%E6%8D%A2
26.什么是线程和进程?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#26%E4%BB%80%E4%B9%88%E6%98%AF%E7%BA%BF%E7%A8%8B%E5%92%8C%E8%BF%9B%E7%A8%8B
27.程序计数器为什么是私有的?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#27%E7%A8%8B%E5%BA%8F%E8%AE%A1%E6%95%B0%E5%99%A8%E4%B8%BA%E4%BB%80%E4%B9%88%E6%98%AF%E7%A7%81%E6%9C%89%E7%9A%84
28.虚拟机栈和本地方法栈为什么是私有的?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#28%E8%99%9A%E6%8B%9F%E6%9C%BA%E6%A0%88%E5%92%8C%E6%9C%AC%E5%9C%B0%E6%96%B9%E6%B3%95%E6%A0%88%E4%B8%BA%E4%BB%80%E4%B9%88%E6%98%AF%E7%A7%81%E6%9C%89%E7%9A%84
29.并发与并行的区别?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#29%E5%B9%B6%E5%8F%91%E4%B8%8E%E5%B9%B6%E8%A1%8C%E7%9A%84%E5%8C%BA%E5%88%AB
30.什么是线程死锁?如何避免死锁?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#30%E4%BB%80%E4%B9%88%E6%98%AF%E7%BA%BF%E7%A8%8B%E6%AD%BB%E9%94%81%E5%A6%82%E4%BD%95%E9%81%BF%E5%85%8D%E6%AD%BB%E9%94%81
31.sleep() 方法和 wait() 方法的区别和共同点?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#31sleep-%E6%96%B9%E6%B3%95%E5%92%8C-wait-%E6%96%B9%E6%B3%95%E7%9A%84%E5%8C%BA%E5%88%AB%E5%92%8C%E5%85%B1%E5%90%8C%E7%82%B9
32.为什么我们调用 start() 方法时会执行 run() 方法,为什么我们不能直接调用 run() 方法?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#32%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E4%BB%AC%E8%B0%83%E7%94%A8-start-%E6%96%B9%E6%B3%95%E6%97%B6%E4%BC%9A%E6%89%A7%E8%A1%8C-run-%E6%96%B9%E6%B3%95%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E4%BB%AC%E4%B8%8D%E8%83%BD%E7%9B%B4%E6%8E%A5%E8%B0%83%E7%94%A8-run-%E6%96%B9%E6%B3%95
33.什么是线程安全问题?如何解决?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#33%E4%BB%80%E4%B9%88%E6%98%AF%E7%BA%BF%E7%A8%8B%E5%AE%89%E5%85%A8%E9%97%AE%E9%A2%98%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3
34.什么是活锁?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#34%E4%BB%80%E4%B9%88%E6%98%AF%E6%B4%BB%E9%94%81
35.什么是线程的饥饿问题?如何解决?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#35%E4%BB%80%E4%B9%88%E6%98%AF%E7%BA%BF%E7%A8%8B%E7%9A%84%E9%A5%A5%E9%A5%BF%E9%97%AE%E9%A2%98%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3
36.什么是线程的阻塞问题?如何解决?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#36%E4%BB%80%E4%B9%88%E6%98%AF%E7%BA%BF%E7%A8%8B%E7%9A%84%E9%98%BB%E5%A1%9E%E9%97%AE%E9%A2%98%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3
37.synchronized 关键字和 volatile 关键字的区别https://github.com/Growing111/JavaInterview/blob/main/多线程.md#37synchronized-%E5%85%B3%E9%94%AE%E5%AD%97%E5%92%8C-volatile-%E5%85%B3%E9%94%AE%E5%AD%97%E7%9A%84%E5%8C%BA%E5%88%AB
38.说一说几种常见的线程池及适用场景?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#38%E8%AF%B4%E4%B8%80%E8%AF%B4%E5%87%A0%E7%A7%8D%E5%B8%B8%E8%A7%81%E7%9A%84%E7%BA%BF%E7%A8%8B%E6%B1%A0%E5%8F%8A%E9%80%82%E7%94%A8%E5%9C%BA%E6%99%AF
39.线程池都有哪几种工作队列?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#39%E7%BA%BF%E7%A8%8B%E6%B1%A0%E9%83%BD%E6%9C%89%E5%93%AA%E5%87%A0%E7%A7%8D%E5%B7%A5%E4%BD%9C%E9%98%9F%E5%88%97
40.什么是线程安全?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#40%E4%BB%80%E4%B9%88%E6%98%AF%E7%BA%BF%E7%A8%8B%E5%AE%89%E5%85%A8
41.Java中如何获取到线程dump文件https://github.com/Growing111/JavaInterview/blob/main/多线程.md#41java%E4%B8%AD%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E5%88%B0%E7%BA%BF%E7%A8%8Bdump%E6%96%87%E4%BB%B6
42.Java中用到的线程调度算法是什么?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#42java%E4%B8%AD%E7%94%A8%E5%88%B0%E7%9A%84%E7%BA%BF%E7%A8%8B%E8%B0%83%E5%BA%A6%E7%AE%97%E6%B3%95%E6%98%AF%E4%BB%80%E4%B9%88
43.Thread.sleep(0)的作用是什么?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#43threadsleep0%E7%9A%84%E4%BD%9C%E7%94%A8%E6%98%AF%E4%BB%80%E4%B9%88
44.单例模式的线程安全性https://github.com/Growing111/JavaInterview/blob/main/多线程.md#44%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F%E7%9A%84%E7%BA%BF%E7%A8%8B%E5%AE%89%E5%85%A8%E6%80%A7
45.Semaphore有什么作用?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#45semaphore%E6%9C%89%E4%BB%80%E4%B9%88%E4%BD%9C%E7%94%A8
46.Hashtable的size()方法中明明只有一条语句"return count",为什么还要做同步?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#46hashtable%E7%9A%84size%E6%96%B9%E6%B3%95%E4%B8%AD%E6%98%8E%E6%98%8E%E5%8F%AA%E6%9C%89%E4%B8%80%E6%9D%A1%E8%AF%AD%E5%8F%A5return-count%E4%B8%BA%E4%BB%80%E4%B9%88%E8%BF%98%E8%A6%81%E5%81%9A%E5%90%8C%E6%AD%A5
47.同步方法和同步块,哪个是更好的选择?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#47%E5%90%8C%E6%AD%A5%E6%96%B9%E6%B3%95%E5%92%8C%E5%90%8C%E6%AD%A5%E5%9D%97%E5%93%AA%E4%B8%AA%E6%98%AF%E6%9B%B4%E5%A5%BD%E7%9A%84%E9%80%89%E6%8B%A9
48.高并发、任务执行时间短的业务怎样使用线程池?并发不高、任务执行时间长的业务怎样使用线程池?并发高、业务执行时间长的业务怎样使用线程池?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#48%E9%AB%98%E5%B9%B6%E5%8F%91%E4%BB%BB%E5%8A%A1%E6%89%A7%E8%A1%8C%E6%97%B6%E9%97%B4%E7%9F%AD%E7%9A%84%E4%B8%9A%E5%8A%A1%E6%80%8E%E6%A0%B7%E4%BD%BF%E7%94%A8%E7%BA%BF%E7%A8%8B%E6%B1%A0%E5%B9%B6%E5%8F%91%E4%B8%8D%E9%AB%98%E4%BB%BB%E5%8A%A1%E6%89%A7%E8%A1%8C%E6%97%B6%E9%97%B4%E9%95%BF%E7%9A%84%E4%B8%9A%E5%8A%A1%E6%80%8E%E6%A0%B7%E4%BD%BF%E7%94%A8%E7%BA%BF%E7%A8%8B%E6%B1%A0%E5%B9%B6%E5%8F%91%E9%AB%98%E4%B8%9A%E5%8A%A1%E6%89%A7%E8%A1%8C%E6%97%B6%E9%97%B4%E9%95%BF%E7%9A%84%E4%B8%9A%E5%8A%A1%E6%80%8E%E6%A0%B7%E4%BD%BF%E7%94%A8%E7%BA%BF%E7%A8%8B%E6%B1%A0
49.在Java中Lock接口比synchronized块的优势是什么?你需要实现一个高效的缓存,它允许多个用户读,但只允许一个用户写,以此来保持它的完整性,你会怎样去实现它?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#49%E5%9C%A8java%E4%B8%ADlock%E6%8E%A5%E5%8F%A3%E6%AF%94synchronized%E5%9D%97%E7%9A%84%E4%BC%98%E5%8A%BF%E6%98%AF%E4%BB%80%E4%B9%88%E4%BD%A0%E9%9C%80%E8%A6%81%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E9%AB%98%E6%95%88%E7%9A%84%E7%BC%93%E5%AD%98%E5%AE%83%E5%85%81%E8%AE%B8%E5%A4%9A%E4%B8%AA%E7%94%A8%E6%88%B7%E8%AF%BB%E4%BD%86%E5%8F%AA%E5%85%81%E8%AE%B8%E4%B8%80%E4%B8%AA%E7%94%A8%E6%88%B7%E5%86%99%E4%BB%A5%E6%AD%A4%E6%9D%A5%E4%BF%9D%E6%8C%81%E5%AE%83%E7%9A%84%E5%AE%8C%E6%95%B4%E6%80%A7%E4%BD%A0%E4%BC%9A%E6%80%8E%E6%A0%B7%E5%8E%BB%E5%AE%9E%E7%8E%B0%E5%AE%83
50.你将如何使用thread dump?你将如何分析Thread dump?https://github.com/Growing111/JavaInterview/blob/main/多线程.md#50%E4%BD%A0%E5%B0%86%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8thread-dump%E4%BD%A0%E5%B0%86%E5%A6%82%E4%BD%95%E5%88%86%E6%9E%90thread-dump
参考资料https://github.com/Growing111/JavaInterview/blob/main/多线程.md#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#1说说synchronized的实现原理
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#2reentrantlock与synchronized的区别
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#3reentrantlock实现原理
https://blog.csdn.net/yanbin0830/article/details/107542529https://blog.csdn.net/yanbin0830/article/details/107542529
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#4java原子类atomicinteger实现原理
https://www.cnblogs.com/scuwangjun/p/9098057.htmlhttps://www.cnblogs.com/scuwangjun/p/9098057.html
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#5java线程池实现原理
https://www.cnblogs.com/dolphin0520/p/3932921.htmlhttps://www.cnblogs.com/dolphin0520/p/3932921.html
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#6threadlocal实现原理
https://www.cnblogs.com/fsmly/p/11020641.htmlhttps://www.cnblogs.com/fsmly/p/11020641.html
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#7inheritablethreadlocal原理知道吗
https://www.jianshu.com/p/94ba4a918ff5https://www.jianshu.com/p/94ba4a918ff5
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#8说一下synchronized锁升级过程
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#9了解过什么是伪共享吗
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#10伪共享出现的原因是什么
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#11如何避免伪共享
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#12java里的线程有哪些状态
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#13什么是悲观锁什么是乐观锁
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#14怎么停止一个运行中的线程
https://www.cnblogs.com/liyutian/p/10196044.htmlhttps://www.cnblogs.com/liyutian/p/10196044.html
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#15说一下你对volatile的理解
https://blog.csdn.net/yinbucheng/article/details/71305951/https://blog.csdn.net/yinbucheng/article/details/71305951/
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#16并发编程三要素
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#17创建线程有哪些方式
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#18线程池的优点
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#19cyclicbarrier和countdownlatch的区别
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#20什么是cas
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#21cas的问题
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#22什么是aqs
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#23aqs支持几种同步方式
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#24什么是自旋锁
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#25什么是多线程的上下文切换
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#26什么是线程和进程
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#27程序计数器为什么是私有的
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#28虚拟机栈和本地方法栈为什么是私有的
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#29并发与并行的区别
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#30什么是线程死锁如何避免死锁
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#31sleep-方法和-wait-方法的区别和共同点
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#32为什么我们调用-start-方法时会执行-run-方法为什么我们不能直接调用-run-方法
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#33什么是线程安全问题如何解决
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#34什么是活锁
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#35什么是线程的饥饿问题如何解决
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#36什么是线程的阻塞问题如何解决
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#37synchronized-关键字和-volatile-关键字的区别
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#38说一说几种常见的线程池及适用场景
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#39线程池都有哪几种工作队列
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#40什么是线程安全
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#41java中如何获取到线程dump文件
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#42java中用到的线程调度算法是什么
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#43threadsleep0的作用是什么
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#44单例模式的线程安全性
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#45semaphore有什么作用
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#46hashtable的size方法中明明只有一条语句return-count为什么还要做同步
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#47同步方法和同步块哪个是更好的选择
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#48高并发任务执行时间短的业务怎样使用线程池并发不高任务执行时间长的业务怎样使用线程池并发高业务执行时间长的业务怎样使用线程池
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#49在java中lock接口比synchronized块的优势是什么你需要实现一个高效的缓存它允许多个用户读但只允许一个用户写以此来保持它的完整性你会怎样去实现它
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#50你将如何使用thread-dump你将如何分析thread-dump
https://github.com/Growing111/JavaInterview/blob/main/多线程.md#参考资料
https://blog.csdn.net/tanmomo/article/details/99671622https://blog.csdn.net/tanmomo/article/details/99671622
https://blog.csdn.net/cmyperson/article/details/79610870https://blog.csdn.net/cmyperson/article/details/79610870
https://www.cnblogs.com/toria/p/11234323.htmlhttps://www.cnblogs.com/toria/p/11234323.html
https://www.cnblogs.com/bors/p/dxc.htmlhttps://www.cnblogs.com/bors/p/dxc.html
http://ifeve.com/15-java-faq/http://ifeve.com/15-java-faq/
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.