• 全部
  • 经验案例
  • 典型配置
  • 技术公告
  • FAQ
  • 漏洞说明
  • 全部
  • 全部
  • 大数据引擎
  • 知了引擎
产品线
搜索
取消
案例类型
发布者
是否解决
是否官方
时间
搜索引擎
匹配模式
高级搜索

高级队列锁Lock与低级内存锁的区别?

2天前提问
  • 0关注
  • 0收藏,50浏览
粉丝:0人 关注:0人

问题描述:

高级队列锁Lock与低级内存锁的区别:

1.Lock的种类多,如TM,TX,TT等等;

2.Lock作用于数据库Object,Lacth只作用于SGA内存中;

3.Lock的释放需要等到事务结束,Latch是瞬间的占用和释放;

4.Lock存在死锁,Latch不存在死锁(因free lock机制)

 

低级内存锁与中级内存锁的区别,主要在于低级内存锁有lock free机制(无锁式编程):即请求latch时,如果该latch不可用,进程会在CPU中等待小段时间(spin)然后重新请求latch。如果依然不可用,该进程会重复以上步骤去请求latch。重复的次数默认值为2000(mutex为500)。如果在重复次数内还是请求不到latch,进程会在v$session_wait中记录latch free等待事件,然后释放cpu,转入睡眠状态。当睡眠一定时间后,进程被唤醒并重复上面的过程,一直到成功获取latch。因此低级内存锁避免了死锁的存在。此外,中级内存锁往往执行多条记录才会释放,而低级内存锁执行几条就可能会释放。

 

 

yiyan.baidu.com/share/mWZ9SvOyTF

yiyan.baidu.com/share/LkRGggy62z

yiyan.baidu.com/share/NYNHpfZ94L

yiyan.baidu.com/share/Y2RSEnvRas

yiyan.baidu.com/share/WB1DRD3qHv

yiyan.baidu.com/share/UOdcmMyHYk

yiyan.baidu.com/share/afu92CTbvw

yiyan.baidu.com/share/Royslmt5NE

yiyan.baidu.com/share/FLUveRR8o5

yiyan.baidu.com/share/0rOv9eiQfG

yiyan.baidu.com/share/j54s4hWPs0

yiyan.baidu.com/share/kY4XSjEa3t

yiyan.baidu.com/share/RWcvhZfcT9

yiyan.baidu.com/share/Y7zcCsSZOU

yiyan.baidu.com/share/XbumZ6cU75

yiyan.baidu.com/share/XDTZBaSwdc

yiyan.baidu.com/share/2rW4ksHOEZ

yiyan.baidu.com/share/t9gW3L9bMG

yiyan.baidu.com/share/2C0Pgf3qvZ

yiyan.baidu.com/share/n4yP1WjeqK

yiyan.baidu.com/share/Bd9sYgjTzt

yiyan.baidu.com/share/VYKfN1GbxX

yiyan.baidu.com/share/ctzhYVV6U3

yiyan.baidu.com/share/f6EFn52sLm

yiyan.baidu.com/share/RsmuPaekL3

yiyan.baidu.com/share/GlTk5e6Eth

yiyan.baidu.com/share/rEs5d6zfOV

yiyan.baidu.com/share/SdUfUwLgfk

yiyan.baidu.com/share/nwArDDAj1s

yiyan.baidu.com/share/iGtE7EELim

yiyan.baidu.com/share/2spR6aYXAT

yiyan.baidu.com/share/HIs0bdjIn9

yiyan.baidu.com/share/U4UPQIiNhy

yiyan.baidu.com/share/KSV4OxNpcS

yiyan.baidu.com/share/bFaScwjov3

yiyan.baidu.com/share/wNUd0Up8Qq

yiyan.baidu.com/share/eCf4luMUnP

yiyan.baidu.com/share/St5ORiPR52

yiyan.baidu.com/share/Q5QjXUXGQZ

yiyan.baidu.com/share/feB3tFlBEd

yiyan.baidu.com/share/7f5S8aX0OC

yiyan.baidu.com/share/w1aa2idg3U

yiyan.baidu.com/share/ep543yIGhN

yiyan.baidu.com/share/xbTXtdGoqQ

yiyan.baidu.com/share/E6Q689eDTV

yiyan.baidu.com/share/wzGGo8DzD4

yiyan.baidu.com/share/3jGG6CqzhI

yiyan.baidu.com/share/ZUIP4mDb3r

yiyan.baidu.com/share/ifqHGP8Eca

yiyan.baidu.com/share/3ahUfMs709

yiyan.baidu.com/share/fBc4cbNGXb

yiyan.baidu.com/share/ZbSSHgHpil

yiyan.baidu.com/share/DVlaIEyuCC

yiyan.baidu.com/share/cLGnHzS9Zy

yiyan.baidu.com/share/s97rGDYVIv

yiyan.baidu.com/share/8qWFpplBIt

yiyan.baidu.com/share/0VEBVKWNV1

yiyan.baidu.com/share/VsZWeqYBKy

yiyan.baidu.com/share/qf1grZ61Nq

yiyan.baidu.com/share/RE4hD0txbQ

yiyan.baidu.com/share/nrzzFvv70G

yiyan.baidu.com/share/veo0NlZqwp

yiyan.baidu.com/share/GCHe1jA5cd

yiyan.baidu.com/share/V6lwjwYyw9

yiyan.baidu.com/share/tOi87OwUcf

yiyan.baidu.com/share/iT0TSGNH0H

yiyan.baidu.com/share/C5LbsDCtUv

yiyan.baidu.com/share/S5exQfqZGX

yiyan.baidu.com/share/6l3UAIF59p

yiyan.baidu.com/share/gP1HY237ym

yiyan.baidu.com/share/aCEwH4CVCG

yiyan.baidu.com/share/u3od78Uxkb

yiyan.baidu.com/share/0EXVBTQGoX

yiyan.baidu.com/share/vmjGLlDzEA

yiyan.baidu.com/share/ktXAxiCHDp

yiyan.baidu.com/share/hVn51uYX82

yiyan.baidu.com/share/GUxht5RCNr

yiyan.baidu.com/share/LxUTEKOzEN

yiyan.baidu.com/share/8YSWf3pRc6

yiyan.baidu.com/share/pyNdZD8rn8

yiyan.baidu.com/share/ctrSwdvp4q

yiyan.baidu.com/share/j2vGh1CXC2

yiyan.baidu.com/share/9KexqnSFXz

yiyan.baidu.com/share/oaI5You5bu

yiyan.baidu.com/share/ljYapgfeCW

yiyan.baidu.com/share/fFOskxPF8y

yiyan.baidu.com/share/7PVvN9cfSP

yiyan.baidu.com/share/djgyFftS3p

yiyan.baidu.com/share/GmISsHlVYP

yiyan.baidu.com/share/m0l88BeepM

yiyan.baidu.com/share/ILS1uYs3nM

yiyan.baidu.com/share/bLDVdbGefE

yiyan.baidu.com/share/dE8IYpSiRF

yiyan.baidu.com/share/DlbG1UKNxX

yiyan.baidu.com/share/erxANs7kbc

yiyan.baidu.com/share/grXGNhSWjn

yiyan.baidu.com/share/2C239E3wON

yiyan.baidu.com/share/YWWuDKu0SS

yiyan.baidu.com/share/EmD7QZrmls

yiyan.baidu.com/share/AXaGo5kH9Y

yiyan.baidu.com/share/gxzG5tabkN

yiyan.baidu.com/share/l4bHHjWO8L

yiyan.baidu.com/share/UnzPYQLXni

yiyan.baidu.com/share/2wVAlaIPd0

yiyan.baidu.com/share/aNFrE9irX6

yiyan.baidu.com/share/GRoeMgSmGn

yiyan.baidu.com/share/q72Ia9PGnF

yiyan.baidu.com/share/E5WwzwdYyG

yiyan.baidu.com/share/qOcDkwF7OK

yiyan.baidu.com/share/pp6ByM3FRW

yiyan.baidu.com/share/daLq1VthWS

yiyan.baidu.com/share/iMBugsPaYT

yiyan.baidu.com/share/WGmjzDtHS0

yiyan.baidu.com/share/anyv1bn0uI

yiyan.baidu.com/share/53pYI4h0OT

yiyan.baidu.com/share/6jw1Y0nMAr

yiyan.baidu.com/share/6aOUdDB2Qr

yiyan.baidu.com/share/OyYv6G18Cr

yiyan.baidu.com/share/lmy6xqSEQd

yiyan.baidu.com/share/CU6fLmh8Pn

yiyan.baidu.com/share/7GzU0y4hH7

yiyan.baidu.com/share/dfCooT8agw

yiyan.baidu.com/share/e2vga13OTo

yiyan.baidu.com/share/BSkSBUmBZ3

yiyan.baidu.com/share/aAhquFfqIc

yiyan.baidu.com/share/9o1TpDR8CO

yiyan.baidu.com/share/tG6Xqe71rZ

yiyan.baidu.com/share/HE28EoaEWW

yiyan.baidu.com/share/M0qPspkNcd

yiyan.baidu.com/share/AWM8FLv5FG

yiyan.baidu.com/share/4udBU8w7hv

yiyan.baidu.com/share/Qo3aK2ctGp

yiyan.baidu.com/share/69lkmuejqF

yiyan.baidu.com/share/3tRTUiT9yh

yiyan.baidu.com/share/hwD7H9qtYs

yiyan.baidu.com/share/pipD049dgN

yiyan.baidu.com/share/j9pPImn50w

yiyan.baidu.com/share/D2NpA3d3eT

yiyan.baidu.com/share/7r0i8vCMpf

yiyan.baidu.com/share/qtjBtifcbZ

yiyan.baidu.com/share/HE2LICmRWY

yiyan.baidu.com/share/1VyAacctlj

yiyan.baidu.com/share/IRrhATHeRx

yiyan.baidu.com/share/UF1l9H7nTr

yiyan.baidu.com/share/8m1z75eSjC

yiyan.baidu.com/share/f6AkndKiPl

yiyan.baidu.com/share/weQZEt4BmH

yiyan.baidu.com/share/BjVO9nyaVf

yiyan.baidu.com/share/nKoqeIMAoP

yiyan.baidu.com/share/WLQDHPBMHy

yiyan.baidu.com/share/F0kCuljor8

yiyan.baidu.com/share/tQeANHij6f

yiyan.baidu.com/share/5urNIX3ziV

yiyan.baidu.com/share/RwS2eT0cqL

yiyan.baidu.com/share/UGdiuR8PxX

yiyan.baidu.com/share/0roh2mexdb

yiyan.baidu.com/share/tZHTDLDvff

yiyan.baidu.com/share/kDfsGko5FV

yiyan.baidu.com/share/cMhAd4Wssi

yiyan.baidu.com/share/kGCg4vAjaI

yiyan.baidu.com/share/75708SNjs6

yiyan.baidu.com/share/vHDevmoB9F

yiyan.baidu.com/share/c6Qec9TvDu

yiyan.baidu.com/share/EQ1VI3ARBT

yiyan.baidu.com/share/Tr4LzdRhyR

yiyan.baidu.com/share/7egeVV8RQI

yiyan.baidu.com/share/mWTiV3BGOu

yiyan.baidu.com/share/4WEEKYMInz

yiyan.baidu.com/share/G6EAzLq76c

yiyan.baidu.com/share/Ycklmp2hx5

yiyan.baidu.com/share/Mc3Gdq8x9Y

yiyan.baidu.com/share/rwBIns4Mgv

yiyan.baidu.com/share/gfrj2Cxtqk

yiyan.baidu.com/share/8M2MbcaZMl

yiyan.baidu.com/share/iBq07alAsG

yiyan.baidu.com/share/X9bbwG09qO

yiyan.baidu.com/share/HhYYOddY6k

yiyan.baidu.com/share/KOGCG7E2cq

yiyan.baidu.com/share/YoMQtDkcVB

yiyan.baidu.com/share/3VlgnQuhKQ

yiyan.baidu.com/share/Yg5pZzg8x0

yiyan.baidu.com/share/ehlMUDRrvW

yiyan.baidu.com/share/Vf77DxUA7j

yiyan.baidu.com/share/KUUgKQPBa1

yiyan.baidu.com/share/tx3BEIf0x9

yiyan.baidu.com/share/tQGivn6xKF

yiyan.baidu.com/share/rhMDofvxG8

yiyan.baidu.com/share/AEx8dWWIx1

yiyan.baidu.com/share/3iOKs5v7pI

yiyan.baidu.com/share/aylHdX1AQj

yiyan.baidu.com/share/DyKENRQV5K

yiyan.baidu.com/share/mNi52BDnD0

yiyan.baidu.com/share/tzX03UCdN1

yiyan.baidu.com/share/8Pw8Aysw7t

yiyan.baidu.com/share/V8aFxM4xUe

yiyan.baidu.com/share/xiCcSwRzL8

yiyan.baidu.com/share/C5Z9EPfYOr

yiyan.baidu.com/share/2A8BP6IcQK

yiyan.baidu.com/share/Z6i7WQUk5p

yiyan.baidu.com/share/KZswCaRICL

yiyan.baidu.com/share/xhvi6HvuGE

yiyan.baidu.com/share/ggcVbzstUQ

yiyan.baidu.com/share/P887l4VUZX

yiyan.baidu.com/share/XZgcoMgd27

yiyan.baidu.com/share/0H7F6E6Bxv

yiyan.baidu.com/share/jjFMjhafUr

yiyan.baidu.com/share/BLgHyYYO4j

yiyan.baidu.com/share/CYS8qGrOXL

yiyan.baidu.com/share/FTTUGgnT3v

yiyan.baidu.com/share/Pv6klwqA4H

yiyan.baidu.com/share/wdPx8YWGjh

yiyan.baidu.com/share/VCKa6ZksyG

yiyan.baidu.com/share/8jUCPioXMt

yiyan.baidu.com/share/eDQ8DCp2gx

yiyan.baidu.com/share/iqZMh1o2fa

yiyan.baidu.com/share/Wd4U6dLRoA

yiyan.baidu.com/share/QeMg61Q7Fg

yiyan.baidu.com/share/bb84tMfCgN

yiyan.baidu.com/share/E2GC49TGO8

yiyan.baidu.com/share/aBoLkinwXP

yiyan.baidu.com/share/QsAtsGl3iS

yiyan.baidu.com/share/ioTk2CtkzF

yiyan.baidu.com/share/um4zRnqcVC

yiyan.baidu.com/share/rt49TbZaBi

yiyan.baidu.com/share/XDdNIz2och

yiyan.baidu.com/share/DXR0UzNQYl

yiyan.baidu.com/share/uPvNfd2D3P

yiyan.baidu.com/share/f2G9wGelro

yiyan.baidu.com/share/CGDwsyoNCG

yiyan.baidu.com/share/AVPkBkldxb

yiyan.baidu.com/share/pgtkPH4dj8

yiyan.baidu.com/share/qCaexzGFjM

yiyan.baidu.com/share/CcHMnaT5gZ

yiyan.baidu.com/share/Lyoqbq7NkS

yiyan.baidu.com/share/AFVYcYvS3L

yiyan.baidu.com/share/zisZhyqUYI

yiyan.baidu.com/share/o0Hc4KwYl2

yiyan.baidu.com/share/UX5Imw6Tbv

yiyan.baidu.com/share/HnY92YbNvw

yiyan.baidu.com/share/ElgqhOQ8ar

yiyan.baidu.com/share/uYyFNbwz9h

yiyan.baidu.com/share/4Y85edir3j

yiyan.baidu.com/share/Z782aT5lV8

yiyan.baidu.com/share/yIeWOMTivG

yiyan.baidu.com/share/yYjZjTQT6q

yiyan.baidu.com/share/ebx93HIun2

yiyan.baidu.com/share/4Nf9C3w75L

yiyan.baidu.com/share/cqv7UikizH

yiyan.baidu.com/share/SoDDgorhnA

yiyan.baidu.com/share/MauB2zwriu

yiyan.baidu.com/share/dVQWwP0id4

yiyan.baidu.com/share/lnucDdfFAY

yiyan.baidu.com/share/gF6GcHY4DW

yiyan.baidu.com/share/0u9441BAiQ

yiyan.baidu.com/share/s4w6SvLWCA

yiyan.baidu.com/share/IZQ5p2xTxC

yiyan.baidu.com/share/2YT1CyNW1z

yiyan.baidu.com/share/3APweRWS7S

yiyan.baidu.com/share/8qLyXPoGEK

yiyan.baidu.com/share/1q59bCeFyN

yiyan.baidu.com/share/lBnH5mmHKS

yiyan.baidu.com/share/AKrebM8RX1

yiyan.baidu.com/share/jW5f0nXGlE

yiyan.baidu.com/share/fp3uF1adS0

yiyan.baidu.com/share/eQ8FHlztLd

yiyan.baidu.com/share/MPQEsgt2pQ

yiyan.baidu.com/share/0oWh883dw5

yiyan.baidu.com/share/bXeOG6nYQ7

yiyan.baidu.com/share/Bx565LRHAG

yiyan.baidu.com/share/OBPLoZYE30

yiyan.baidu.com/share/dG7UZwHORx

yiyan.baidu.com/share/4bkU3sPClK

yiyan.baidu.com/share/UUBIgBGDO7

yiyan.baidu.com/share/jR82o1SR3E

yiyan.baidu.com/share/RMB2agTsl4

yiyan.baidu.com/share/fjc6FmZuOw

yiyan.baidu.com/share/pBHzQjYNPa

yiyan.baidu.com/share/4drCFDlksC

yiyan.baidu.com/share/xI339jSPAg

yiyan.baidu.com/share/aF7n6wfmAQ

yiyan.baidu.com/share/Fokm78lsis

yiyan.baidu.com/share/2KMkcENuEd

yiyan.baidu.com/share/unw4WZ4qau

yiyan.baidu.com/share/wryM6fHmhN

yiyan.baidu.com/share/o3n57fkBTK

yiyan.baidu.com/share/bKVmOizOYn

yiyan.baidu.com/share/bLj03U689z

yiyan.baidu.com/share/fLAISqM9L9

yiyan.baidu.com/share/og7ZjcetP9

yiyan.baidu.com/share/emvgDogWVI

yiyan.baidu.com/share/MqTGxlc0Ao

yiyan.baidu.com/share/V0yHgpiv7K

yiyan.baidu.com/share/rA0qC2yd0z

yiyan.baidu.com/share/SIeQB0tqE0

yiyan.baidu.com/share/QHOHlqHW4w

yiyan.baidu.com/share/oGX7wgjieY

yiyan.baidu.com/share/rz5Gvwi6jI

yiyan.baidu.com/share/eFhN85ouub

yiyan.baidu.com/share/D9kkfLecLA

yiyan.baidu.com/share/sIrOadH13j

 

2 个回答
粉丝:139人 关注:0人

1

暂无评论

粉丝:21人 关注:1人

高级队列锁(Lock)和低级内存锁的主要区别在于它们的使用场景、机制以及对性能的影响。

1. **使用场景**:高级队列锁通常用于更复杂的同步场景,如在多线程环境中保护共享资源,确保数据的一致性和完整性。而低级内存锁,如自旋锁,更适用于短时间的锁定,通常用于保护小范围的内存区域,避免线程间的竞争。

2. **机制**:高级队列锁可能涉及更复杂的锁机制,如公平锁、非公平锁、读写锁等,这些锁机制可以提供更细粒度的控制,减少线程间的等待时间。低级内存锁,如自旋锁,当一个线程试图获取已被占用的锁时,它不会立即阻塞,而是继续执行一个循环(自旋),直到锁被释放。这种机制在锁的持有时间很短时可以减少上下文切换的开销。

3. **性能影响**:高级队列锁在锁的获取和释放过程中可能涉及更多的系统调用和上下文切换,这在锁的持有时间较长时可以减少资源浪费。而低级内存锁在锁的持有时间很短时可以减少上下文切换的开销,但在锁的持有时间较长时,自旋锁会消耗大量的CPU资源,导致其他线程无法运行。

4. **数据落盘机制与缓存使用**:高级队列锁和低级内存锁在数据的落盘机制和缓存使用方面没有直接关系,但它们可能间接影响到这些机制的效率。例如,如果锁保护的资源是需要频繁访问的缓存数据,那么锁的效率将直接影响到缓存的访问性能。

5. **PFC死锁与恢复**:PFC(Priority-Flow Control)死锁和恢复次数与队列锁的使用有关,但更直接地与网络设备的流量控制机制相关。PFC死锁通常发生在网络设备的队列中,当队列满时,设备会发送PFC帧停止上游设备的发送,如果多个设备同时发生这种情况,可能会导致死锁。死锁恢复次数则反映了网络设备从死锁状态中恢复的能力。

综上所述,高级队列锁和低级内存锁在使用场景、机制、性能影响等方面存在显著差异,选择哪种锁取决于具体的应用需求和性能要求。

暂无评论

编辑答案

你正在编辑答案

如果你要对问题或其他回答进行点评或询问,请使用评论功能。


分享扩散:

提出建议

    +

亲~登录后才可以操作哦!

确定

亲~检测到您登陆的账号未在http://hclhub.h3c.com进行注册

注册后可访问此模块

跳转hclhub

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作

举报

×

侵犯我的权益 >
对根叔社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 pub.zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明