Changes between Version 14 and Version 15 of library_locks
- Timestamp:
- Nov 27, 2015, 2:14:41 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
library_locks
v14 v15 17 17 18 18 === unsigned int '''atomic_increment'''( unsigned int* shared, unsigned int increment) === 19 This blocking function uses a LL/SC to atomically increment a shared variable. 20 * '''ptr''' : pointer on the shared variable 21 * '''increment''' : increment value. 19 This blocking function uses a LL/SC to atomically increment a shared variable identified by the <ptr> pointer. The <increment> argument define the increment value. It can be a negative value. 22 20 23 21 == __Simple lock access functions__ == 24 22 25 23 === '''void lock_init'''( user_lock_t * lock ) === 26 This function should be called by one single task. 27 * '''lock''' : pointer on the user_lock_t structure. 24 This function initializes the lock identified by the <lock> pointer. It should be called by one single task. 28 25 29 26 === '''void lock_acquire'''( user_lock_t * lock ) === 30 This blocking function returns only when the lock has been successfully taken. 31 * '''lock''' : pointer on the user_lock_t structure. 27 This blocking function returns only when the lock identified by the <lock> pointer has been successfully taken. 32 28 33 29 === '''void lock_release'''( user_lock_t * lock ) === 34 This function releases the lock. It must be called by a task after a successful lock_acquire(). 35 * '''lock''' : pointer on the user_lock_t structure. 30 This function releases the lock identified by he <lock> pointer. It must be called by a task after a successful lock_acquire(). 36 31 37 32 == __Distributed lock access functions__ == … … 44 39 45 40 === '''void sqt_lock_init'''( sqt_lock_t * lock , unsigned int x_size , unsigned int y_size , unsigned int nthreads ) === 46 This function should be called by one single thread. It allocates both the distributed locks in each cluster (from the distributed heaps), and it initializes the sqt_lock_t variable (that must be allocated in the user application data segment). 47 * '''lock''' : pointer on the sqt_lock_t structure. 48 * '''x_size''' : number of clusters in a row. 49 * '''x_size''' : number of clusters in a column. 50 * '''nthreads''' : number of threads per cluster. 41 This function initializes the lock identified by the <lock> pointer. It should be called by one single thread. It allocates both the distributed locks in each cluster (from the distributed heaps), and it initializes the sqt_lock_t variable (that must be allocated in the user application data segment). 42 The <x_size> and <y_size> arguments define the mesh size. The <nthreads> arguments define the number of threads per cluster. 51 43 52 44 === '''void sqt_lock_acquire'''( sqt_lock_t * lock ) === 53 This blocking function returns only when all locks of the distributed tree have been successfully taken. 54 * '''lock''' : pointer on the sqt_lock_t structure. 45 This blocking function returns only when the distributed lock identified by the <lock> pointer has been successfully taken. 55 46 56 47 === '''void sqt_lock_release'''( sqt_lock_t * lock ) === 57 This function releases the lock. It must be called by a task after a successful lock_acquire(). 58 * '''lock''' : pointer on the sqt_lock_t structure. 48 This function releases the distributed lock identified by the <lock> pointer. It must be called by a task after a successful lock_acquire().