Changes between Version 6 and Version 7 of kernel_synchro


Ignore:
Timestamp:
Oct 8, 2018, 1:39:22 PM (6 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • kernel_synchro

    v6 v7  
    2424ALMOS-MKH defines three types of locks to implement exclusive access to these shared structures: ''busylocks'', ''queuelocks'', and ''rwlocks''.
    2525
    26 == C) busylocks & remote_busylocks ==
     26== C) busylocks ==
    2727
    2828The '''busylock''' (local) and '''remote_busylock''' (global) are low-level locks implementing a busy-waiting policy for the calling threads. If the lock is already taken by another thread, the calling thread keep polling the lock until success. They are used to protect higher level synchronisation primitives (such as the ''queuelocks'' or ''rwlocks'' described below) , or ''simple'' data-structure where the locking time is small and can be bounded.
     
    3333To improve fairness, the ''busylock_acquire()'' function uses a ticket policy: the calling thread makes an atomic increment on a ''ticket'' allocator in lock descriptor, and keep polling the ''current'' value  until ''current'' == ''ticket''. To release the lock, the ''busylock_release()'' function increments the "current" value in lock descriptor.
    3434
    35 == D) queuelock & remote_queuelock ==
     35== D) queuelock ==
    3636
    3737The '''queuelock''' (local) and '''remote_queuelock''' (global) are higher level locks implementing a descheduling policy, with registration in a waiting queue. If the lock is already taken by another thread, the calling thread register in a (local or trans-cluster) waiting queue rooted in the queuelock, and deschedules. The first thread T registered in the waiting thread is re-activated by the thread T' holding the lock when T' release the lock. It is used to protect complex structures, where the access can require to get exclusive access to one (or more) other shared resources.
     
    4242A thread holding a queuelock can deschedule, and no special checking is done by the scheduler.
    4343
    44 == E) rwlocks & remote_rwlocks ==
     44== E) rwlocks ==
    4545
    4646The '''rwlock''' (local) and '''remote_rwlock''' (global) support several simultaneous read accesses, but only one write access to a given shared object.