Changes between Version 15 and Version 16 of kernel_synchro
- Timestamp:
- Sep 11, 2020, 4:50:08 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
kernel_synchro
v15 v16 13 13 These barriers being used only during kernel initialization implement a simple busy-waiting policy. They are implemented as global variables, in the kdata segment. These toggle barriers can be used several times, and don't need to be explicitly initialized. For the global barrier (''xbarrier''), the client threads use ''remote_read(), remote_write(), & remote_atomic_add()'' primitives, to access the barrier located in cluster 0. 14 14 15 16 15 == B) Locks general principles == 17 16 … … 52 51 * when a writer completes its access, it reset the "taken" field, releases the first waiting writer if queue non empty, or releases all waiting readers if no writer. 53 52 54 == F) Locks debug ==53 == F) locks debug == 55 54 56 55 Each local or remote busylock contains a <type> field defining the specific resource protected by this lock, that is a non-zero value defined at lock initialization. 57 56 * if the ''busylock'' is directly used to protect access to a shared kernel structure, this type field defines the type of the protected structure. 58 * if the ''busylock'' is used to protect concurrent access to an higher level lock (queuelock or rwlock), the <type> field define the type of the structure protected by thehigher level lock.59 The exi ting lock types are defined in the <kernel_config.h> file.57 * if the ''busylock'' is used to protect concurrent access to an higher level lock (queuelock or rwlock), the <type> field defines the type of the structure protected by this higher level lock. 58 The existing lock types are defined in the <kernel_config.h> file. 60 59 61 60 === F.1 busylock debug === … … 65 64 1. Each thread contains - besides the ''busylocks'' counter - an optional ''busylocks_root'' field, that is the root of an embedded xlist of (local or remote) busylocks hold by a given thread at a given time. This list is implemented by an optional ''xlist'' field in the busy lock descriptor. It is dynamically updated by the ''busylock_acquire()'' and ''busylock_release()'' functions. The set of taken busylocks is printed in the error message, when the scheduler detects that a descheduling thread is holding one or several busylocks. This list can also be printed through the ''idbg'' interactive debugger, for any thread identified by its (pid,trdid). 66 65 67 2. Moreover, when DEBUG_BUSYLOCK is set, all busylock_acquire() / busylock_release() made by the thread, identified by the DEBUG_BUSYLOCK_PID and DEBUG_BUSYLOCK_TRDID parameters (defined in the kernel_config.h file) are traced on kernel TXT0.66 2. All ''busylock_acquire() / busylock_release()'' made by the thread[pid,trdid], are traced on kernel TXT0. The DEBUG_BUSYLOCK_PID DEBUG_BUSYLOCK_TRDID parameters are defined in the <kernel_config.h> file) 68 67 69 68 === F.2 higher level lock debug ===