Changes between Version 10 and Version 11 of kernel_locks
- Timestamp:
- Dec 6, 2014, 2:19:09 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
kernel_locks
v10 v11 3 3 [[PageOutline]] 4 4 5 The [source:soft/giet_vm/giet_common/locks.c locks.c] and [source:soft/giet_vm/giet_common/locks.h locks.h] files define the functions used by the kernel to take & release locks protecting exclusive access to a shared resource.5 The [source:soft/giet_vm/giet_common/locks.c locks.c] and [source:soft/giet_vm/giet_common/locks.h locks.h] files define the functions used by the kernel to take & release locks protecting exclusive access to shared resources. 6 6 7 7 The GIET_VM kernel define three types of spin-lock: 8 8 9 1. The '''simple_lock_t''' implements a spin-lock without waiting queue. It is only used by the TTY0 access functions, to get exclusive access to the TTY0 kernel terminal.9 1. The '''simple_lock_t''' implements a non-distributed spin-lock without waiting queue. 10 10 11 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 12 must be initialised. 13 13 14 3. The '''sbt_lock_t''' spin-lock can be used when a single lock protect a unique resource that can be used by any task 15 running on a 2D mesh of clusters. The lock is implemented as a Sliced Binary Tree of ''partial'' locks distributed on all cluster 16 of a 2D mesh. It is intended to avoid contention on a single cluster when all tasks try to access the same lock. 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. 17 15 18 16 All the lock access functions are prefixed by "_" to remind that they can only be executed by a processor in kernel mode.