当前位置:网站首页>GBASE 8s并发控制之封锁类型
GBASE 8s并发控制之封锁类型
2022-04-23 01:17:00 【八珍豆腐】
按照锁的行为模式,可以将8s 中锁分成:共享锁、排他锁、和提升锁三种类型。
共享锁[读锁、S锁]
共享锁,可以防止其他用户对记录进行修改。但可以同时对该数据对象上共享锁&意向锁。只有该数据被释放所有共享锁后,才可以上排他锁。
套用现实的例子:教室的黑板上有很多老师的板书,每个同学在边看边记笔记,没有人希望有捣蛋鬼在黑板上涂改,这样会导致看过去的东西是乱的。所以再大家都在看黑板的时候,每个人都声明现在不许有人涂涂改改【写锁】。但是可以提前跟我们说一下要涂改东西【意向锁】,但是你要是也想看板书,那你就要加入我们【共享锁】。
排他锁[写锁、X锁]
排他锁,用来管理并更新,也可叫独占锁,被上X锁的数据,只允许上锁事务对其进行读写操作。
提升锁[意向锁、U锁]
表示事务有修改记录的意图,它是一种过渡类型的锁,会由U锁提升至X锁,若某数据有U锁,则其他事务只可以对该数据对象上S锁。
总结:写锁不与任何锁共存、读锁可以和读锁共存,只可有一个提升锁。
ps:写完这几篇锁的介绍后我已经不认识锁这个字了。
版权声明
本文为[八珍豆腐]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_57486087/article/details/124347202
边栏推荐
- How to introduce SPI into a project
- VS+C# 实现窗体输入框默认显示灰色文字
- What is October 24th? Why are there no senior programmers in China in their fifties and sixties, while foreigners,,, Yu Nianyu Hui take you to celebrate the 1024 programmer Festival
- gin -get请求的小示例1-Handle处理GET请求
- Type conversion in C - Custom implicit and explicit conversion
- Android international area code, registered mobile phone number code and list of common cities, Android memory optimization interview
- Articles for May
- 留给给5月的文章
- 为企业出海“搭桥”,汇量科技靠什么出圈?
- Daily practice (47): find different
猜你喜欢

Detailed explanation of the usage of C language getchar

Xizhi technology Shen Yichen was selected as the "global youth leader" of the world economic forum in Davos in 2022

员工公寓楼建设项目电力监控系统的研究与应用

Fault analysis | federated storage engine table causes the monitoring thread to be in the opening table state

Basic knowledge of software testing (detailed version) collection of this article is enough

Secret of 66% performance surge: AMD 25000 yuan 768mb 3D cache Xiaolong opened the cover for the first time
![[Ethernet switching security] - switch flow control / DHCP snooping / IP source guard](/img/cc/bbabc5621b8485d04ffa7d4d5fad2e.png)
[Ethernet switching security] - switch flow control / DHCP snooping / IP source guard

Alibaba cloud container & Service Grid product technology trends (202203)

Project manager's thinking mode worth trying: project success equation

Source code analysis of synchronousqueue
随机推荐
Real time monitoring and management of distribution circuit power consumption of acrel-2000 power monitoring system in xingqingfang Xinxing square distribution substation
Activity preview | on April 23, a number of wonderful openmldb sharing came, which lived up to the good time of the weekend!
Pilotage growth · ingenuity empowerment -- yonmaster developer training and pilotage plan is fully launched
Mobile Jingdong Mall
[HCTF 2018]admin
Open WebRTC Toolkit(OWT) Server User Guide
留给给5月的文章
Is 2022 software testing easy to learn? How long will it take? (learning roadmap attached)
【服务器数据恢复】服务器硬盘进水后服务器崩溃的数据恢复案例
京東一面:子線程如何獲取父線程 ThreadLocal 的值?我蒙了。。。
tdengine集群安装部署
[ACTF2020 新生赛]Include
gin框架的学习--golang
员工公寓楼建设项目电力监控系统的研究与应用
智能照明控制系统在医院的设计与应用
那些咸鱼上买来的代码|ssm酒店客房管理系统|买来的源码是否真的可以使用|来自程序员的困惑|玉念聿辉|大丑村吴明辉
移動端京東商城
Get in the car, the era of intelligent database autonomy has come, and Tencent cloud database x AI has made a new breakthrough
Is it difficult for girls to learn software testing?
200. Number of islands