Changes between Version 6 and Version 7 of kernel_synchro
- Timestamp:
- Oct 8, 2018, 1:39:22 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
kernel_synchro
v6 v7 24 24 ALMOS-MKH defines three types of locks to implement exclusive access to these shared structures: ''busylocks'', ''queuelocks'', and ''rwlocks''. 25 25 26 == C) busylocks & remote_busylocks==26 == C) busylocks == 27 27 28 28 The '''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. … … 33 33 To 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. 34 34 35 == D) queuelock & remote_queuelock==35 == D) queuelock == 36 36 37 37 The '''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. … … 42 42 A thread holding a queuelock can deschedule, and no special checking is done by the scheduler. 43 43 44 == E) rwlocks & remote_rwlocks==44 == E) rwlocks == 45 45 46 46 The '''rwlock''' (local) and '''remote_rwlock''' (global) support several simultaneous read accesses, but only one write access to a given shared object.