postgreSQL 中的 Lock
typedef struct LOCK /* data */ LOCALLOCK 是在私有进程中的结构,它有指针指向共享内存中实际的锁 typedef struct LOCALLOCK /* data */ 共享内存中实际的锁 typedef struct LOCK /* data */ LOCALLOCK 和 LOCK 为了方便查找,全部放在了 hash table 中 We may have several different backends holding or awaiting locks on the same lockable object. We need to store some per-holder/waiter information for each such holder (or would-be holder). This is kept in a PROCLOCK struct typedef struct PROCLOCK /* data */ 未获得锁的等待是通过每个进程的临界区实现的,当没获得锁时,就进入本进程的临界区,并把本进程放入LOCK的waitProcs队列中,当别的进程解锁后,检查waitProcs,把里面存储的等候的进程出临界区 锁的种类 #define NoLock 0 #define AccessShareLock 1 /* SELECT */#define RowShareLock 2 /* SELECT FOR UPDATE/FOR SHARE */#define RowExclusiveLock 3 /* INSERT,UPDATE,DELETE */#define ShareUpdateExclusiveLock 4 /* VACUUM (non-FULL),ANALYZE,CREATE * INDEX CONCURRENTLY */#define ShareLock 5 /* CREATE INDEX (WITHOUT CONCURRENTLY) */#define ShareRowExclusiveLock 6 /* like EXCLUSIVE MODE,but allows ROW * SHARE */#define ExclusiveLock 7 /* blocks ROW SHARE/SELECT...FOR * UPDATE */#define AccessExclusiveLock 8 /* ALTER TABLE,DROP TABLE,VACUUM * FULL,and unqualified LOCK TABLE */ (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- QT19 How to link QComboBox with sqlite Database values
- c – 具有Boost的Node-gyp包含和库目录
- DWR实例教程
- c# – 如何使用HashAlgorithm.TransformBlock / TransformF
- NoSQL(MongoDB,Redis,Tokyo Cabinet, Berkeley DB)解决方案
- Cocos开发中性能优化工具介绍(一):Xcode中Instruments工
- ruby – 如何将数组值与散列数组合?
- ruby-on-rails – 如何取消deliver_email挂钩中的电子邮件?
- ORACLE 12C 三节点 RAC 无法找到候选磁盘
- C中的子程序是否与Fortran中的子程序相似?