mirror of
https://github.com/huihut/interview.git
synced 2024-03-22 13:10:48 +08:00
https://github.com/huihut/interview/pull/76
This commit is contained in:
parent
0adfa8dcd1
commit
e6dbc2b9c3
|
@ -2650,7 +2650,7 @@ So there is a FIN and ACK in each direction.
|
||||||
* Basic lock types: exclusive lock (X lock / write lock), shared lock (S lock / read lock).
|
* Basic lock types: exclusive lock (X lock / write lock), shared lock (S lock / read lock).
|
||||||
* Livelock deadlock:
|
* Livelock deadlock:
|
||||||
* Livelock: The transaction is always in a waiting state, which can be avoided through a first come, first served policy.
|
* Livelock: The transaction is always in a waiting state, which can be avoided through a first come, first served policy.
|
||||||
* Deadlock: Things can never end
|
* Deadlock: The transaction can never end
|
||||||
* Prevention: one-time block method, sequential block method;
|
* Prevention: one-time block method, sequential block method;
|
||||||
* Diagnosis: timeout method, waiting graph method;
|
* Diagnosis: timeout method, waiting graph method;
|
||||||
* Cancel: Undo the transaction with the least deadlock cost and release all the locks of this transaction, so that other transactions can continue to run.
|
* Cancel: Undo the transaction with the least deadlock cost and release all the locks of this transaction, so that other transactions can continue to run.
|
||||||
|
|
|
@ -2642,7 +2642,7 @@ ssize_t write(int fd, const void *buf, size_t count);
|
||||||
* 基本封锁类型:排他锁(X 锁 / 写锁)、共享锁(S 锁 / 读锁)。
|
* 基本封锁类型:排他锁(X 锁 / 写锁)、共享锁(S 锁 / 读锁)。
|
||||||
* 活锁死锁:
|
* 活锁死锁:
|
||||||
* 活锁:事务永远处于等待状态,可通过先来先服务的策略避免。
|
* 活锁:事务永远处于等待状态,可通过先来先服务的策略避免。
|
||||||
* 死锁:事物永远不能结束
|
* 死锁:事务永远不能结束
|
||||||
* 预防:一次封锁法、顺序封锁法;
|
* 预防:一次封锁法、顺序封锁法;
|
||||||
* 诊断:超时法、等待图法;
|
* 诊断:超时法、等待图法;
|
||||||
* 解除:撤销处理死锁代价最小的事务,并释放此事务的所有的锁,使其他事务得以继续运行下去。
|
* 解除:撤销处理死锁代价最小的事务,并释放此事务的所有的锁,使其他事务得以继续运行下去。
|
||||||
|
|
Loading…
Reference in New Issue
Block a user