zoukankan      html  css  js  c++  java
  • [Operating System] {ud923} P3L4: Synchronization Constructs

     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

     

  • 相关阅读:
    asp.net 正则表达式
    字符串分隔
    用定时器实现逐渐放大层的功能
    js获取剪贴板内容
    使用无线网卡共享上网
    使用事件探查器跟踪sqlserver进程
    document.all.WebBrowser.ExecWB
    (转)JAVA与.NET DES加密解密
    web打印的实现
    关于div的定位
  • 原文地址:https://www.cnblogs.com/ecoflex/p/10924954.html
Copyright © 2011-2022 走看看