正在加载图片...
O Multiple Consumer Example tail hea R head R Producer Consumer 1 head R Consumer 2 Producer posting item x Consumer Load Rtail(tail) Load Rhead,(head) Store(rtail,X spin: Load Rtail,(tail) R tail R tail +1 if rhead==Rtail goto spin Store(tail),rtail Load R,(Rt head Rhead=Rhead+1 Critical section Store(head), rhead Needs to be executed atomically process(r) by one consumer What is wrong with this code? 2021/2/11 计算机体系结构Multiple Consumer Example 2021/2/11 计算机体系结构 21 Producer posting Item x: Load Rtail, (tail) Store (Rtail), x Rtail=Rtail+1 Store (tail), Rtail Consumer: Load Rhead, (head) spin: Load Rtail, (tail) if Rhead==Rtail goto spin Load R, (Rhead) Rhead=Rhead+1 Store (head), Rhead process(R) What is wrong with this code? Critical section: Needs to be executed atomically by one consumer tail head Producer Rtail Consumer 1 Rhead R Rtail Consumer 2 Rhead R Rtail
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有