Changes between Version 11 and Version 12 of kernel_locks


Ignore:
Timestamp:
Dec 6, 2014, 3:54:13 PM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • kernel_locks

    v11 v12  
    99 1. The '''simple_lock_t''' implements a non-distributed spin-lock without waiting queue.
    1010
    11  2. The '''spin_lock_t''' implements a spin-lock with a waiting queue (based on a ticket allocator scheme), to enforce fairness and avoid live-lock situations. The GIET_LOCK_MAX_TICKET define the wrapping value for the ticket allocator. This lock
    12 must be initialised.
     11 2. The '''spin_lock_t''' implements a spin-lock with a waiting queue (based on a ticket allocator scheme), to enforce fairness and avoid live-lock situations. The GIET_LOCK_MAX_TICKET define the wrapping value for the ticket allocator. This lock must be initialised.
    1312
    14  3. The '''sbt_lock_t''' spin-lock can be used when a single lock protect a unique resource that can be used by a large number of tasks running on a 2D mesh clusterised architecture. The lock is implemented as a Sliced Binary Tree of ''partial'' locks distributed on all cluster, and is intended to avoid contention on a single cluster when all tasks try to access the same resource.
     13 3. The '''sbt_lock_t''' spin-lock can be used when a single lock protect a unique resource shared by a large number of tasks running on a 2D mesh clusterised architecture. The lock is implemented as a Sliced Binary Tree of ''partial'' locks distributed on all cluster, and is intended to avoid contention on a single cluster when all tasks try to access the same resource.
    1514
    1615All the lock access functions are prefixed by "_" to remind that they can only be executed by a processor in kernel mode.
     
    2827
    2928 === void '''_simple_lock_acquire'''( simple_lock_t * lock ) ===
    30 This blocking function does not implement any ordered allocation, and is not distributed. It returns only when the lock as been granted.
     29This blocking function does not implement any ordered allocation, and is not distributed.
     30It returns only when the lock as been granted.
    3131
    3232 === void '''_simple_lock_release'''( simple_lock_t * lock ) ===
    33 This function releases the lock, and can be used for lock initialisation. It must always be called after a successful _simple_lock_acquire().
     33This function releases the lock, and can be used for lock initialisation.
     34It must always be called after a successful _simple_lock_acquire().
    3435
    3536== Queuing Lock Access functions ==
     
    4647== Distributed Lock Access functions ==
    4748
    48  === void '''sbt_lock_init'''( sbt_lock_t*   lock,  unsigned int   ntasks ) ===
     49 === void '''_sbt_lock_init'''( sbt_lock_t*   lock ) ===
     50This function allocates and initialises the Sliced Binary Tree, distributed on all clusters. The X_SIZE and Y_SIZE parameters defined in the ''hard_config.h'' file must be power of 2, with X_SIZE = Y_SIZE or X_SIZE = 2 * Y_SIZE. This function use the _remote_malloc() function, and the distributed kernel heap segments.
    4951
    50  === void '''sbt_lock_acquire'''( sbt_lock_t*  lock ) ===
     52 === void '''_sbt_lock_acquire'''( sbt_lock_t*  lock ) ===
     53This function tries to acquire the SBT lock: It tries to get each "partial" lock on the path from bottom to top, using an atomic LL/SC, and starting from bottom. It is blocking : it polls each "partial" lock until it can be taken, and returns only  when all "partial" locks, at all levels have been obtained.
    5154
    52  === void '''sbt_lock_release'''( sbt_lock_t*  lock ) ===
     55 === void '''_sbt_lock_release'''( sbt_lock_t*  lock ) ===
     56This function releases the SBT lock: It reset all "partial" locks on the path from bottom to top, using a normal write, and starting from bottom.
    5357
    5458