惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
S
SegmentFault 最新的问题
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
U
Unit 42
腾讯CDC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Cloudflare Blog
H
Help Net Security
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
H
Heimdal Security Blog
博客园 - 聂微东
S
Securelist
大猫的无限游戏
大猫的无限游戏
Cloudbric
Cloudbric
Cisco Talos Blog
Cisco Talos Blog

博客园 - Feelwindy1

博文阅读密码验证 - 博客园 Windows Live Messenger Beta的邀请 浅谈存储过程与函数的区 Ajax程序设计入门 [转] NHibernate(转) 与女友的相处之道(转) 两点连接寻径算法 软件架构与设计模式 Enterprise JavaBeans导论[转] 设计模式:MVC模式 (java) 构架师之路 ADO.NET事务和Set Xact_Abort 以及MSDTC Eclipse基础--使用links方式安装Eclipse插件 debug与release - Feelwindy1 - 博客园 分布式数据库事务 Winform在设计上的一个小Bug 连连看源码调试问题 连连看精简测试版源码 响应号召,发布连连看(C#+MDX9 精简测试版)
阻塞和死锁
Feelwindy1 · 2005-06-06 · via 博客园 - Feelwindy1

阻塞和死锁是两个不同的概念。
举个例子,现在有线程1和线程2,线程1占用了资源A,线程2占用了资源B。此时线程2需要使用资源A才能继续,但是资源A被线程1所占用,那么线程2只能等待资源A被线程1释放掉,这种情况称为线程2被阻塞。
但是,如果此时线程1也许要资源B才能继续,那么两个线程都会等待对方释放资源,这种情况就是死锁。
简单地讲,阻塞一般是没有循环调用的,而死锁是有循环调用情况的。

以下一些内容供您参考:
了解和解决 SQL Server 7.0 或 2000 阻塞问题
http://support.microsoft.com/?id=224453

阻塞是没有办法避免的,只要有并发的任务执行,就有可能发生这个现象。
死锁是我们应该重点避免的,主要的方法就是在编写程序的时候尽量考虑使用各种方法避免循环调用,同时设置一个最长等待时间。