码迷,mamicode.com
首页 > 其他好文 > 详细

[Operating System] {ud923} P3L4: Synchronization Constructs

时间:2019-05-26 09:35:18      阅读:116      评论:0      收藏:0      [点我收藏+]

标签:process   monit   src   RoCE   linux   similar   expired   png   mes   

技术图片

 

 

技术图片

 

 

 

 Visual Metaphor

 技术图片

 

 

 

 

 

More About Synchronization 

 技术图片

技术图片

in order to guarantee the correctness of the sync => via atomic instructions

 

 

 

 Spinlocks

 技术图片

 

with mutexes, the thread would have relinquished the CPU and allowed for another thread to run.

 With spinlocks, the thread will spin. It will burn CPU cycles until the lock becomes free or until the thread gets preempted for some reason. eg. spinining until ultimately its time slice expired or potentially a higher priority thread became runable.

 

 

 

Semaphores 

 技术图片

 

 

 

 

Toggle Sidebar POSIX Semaphores 

 技术图片

 

 

 

 Quiz Help

If you need help, then use a sem_init() man page reference. https://linux.die.net/man/3/sem_init

 技术图片

A mutex is sometimes refered to as a binary semaphore in which it can either be "locked" or "free" -- this affects argument 2

 

 

 Reader Writer Locks

 技术图片

 RW locks => reader writer locks => similar to mutex => need to specify the type (R or W)

 

 

 

 Using Reader Writer Locks

技术图片

 

 

 Monitors

 技术图片

 

 

 More Synchronization Constructs

 技术图片

 

 

 

 Sync Building Block Spinlock

 技术图片

We must have some support from the hardware in order to make sure that some of this checking of lock value

 

 

 

 https://blog.csdn.net/qq_21792169/article/details/50822702

 技术图片

 

 

 

Need for Hardware Support 

 技术图片

 

 

Atomic Instructions 

 技术图片

 

 

 

 

 Shared Memory Multiprocessors

 技术图片

 

 

 

 Cache Coherence

 技术图片

 

 

Cache Coherence and Atomics 

 技术图片

 

 

 Spinlock Performance Metrics

 技术图片

 

 

 

Test and Set Spinlock 

 技术图片

 

 

 

 

 Test and Set Spinlock

 技术图片

技术图片

 

 

 

 

Spinlock “Delay” Alternatives 

 技术图片

 

 

Picking a Delay 

 技术图片

 

 

 

Queueing Lock 

 技术图片

 

 

 

 Queueing Lock Implementation

技术图片

 

 

 

 

 Spinlock Performance Comparisons

 技术图片

 

[Operating System] {ud923} P3L4: Synchronization Constructs

标签:process   monit   src   RoCE   linux   similar   expired   png   mes   

原文地址:https://www.cnblogs.com/ecoflex/p/10924954.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!