Changeset 563 for trunk/kernel/libk/barrier.h
- Timestamp:
- Oct 4, 2018, 11:16:13 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/barrier.h
r457 r563 1 1 /* 2 * _barrier.h - localkernel barrier definition2 * barrier.h - Busy-waiting, local, kernel barrier definition 3 3 * 4 * Author Alain Greiner (2016 )4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 31 31 * This structure defines a "rendez-vous" barrier, that can be used 32 32 * to synchronise several kernel threads running in the same cluster. 33 * It is used in the kernel_init phase.33 * As it is used in the kernel_init phase, it implements a busy-waiting policy. 34 34 * It does not need to be initialised, but it must be statically allocated 35 35 * in the KDATA segment to be properly initialised by the compiler/loader. … … 40 40 uint32_t current; // number of arrived threads 41 41 volatile uint32_t sense; // barrier state (toggle) 42 uint32_t pad [(CONFIG_CACHE_LINE_SIZE>>2)-2];42 uint32_t padding[(CONFIG_CACHE_LINE_SIZE>>2)-2]; 43 43 } 44 44 barrier_t; … … 48 48 * expected threads reach the barrier. It can be used several times without 49 49 * specific initialisation. 50 * It is portable, as it uses the remote_lw() & remote_sw() access functions.50 ***************************************************************************************** 51 51 * @ barrier : pointer on barrier 52 52 * @ count : number of expected thread
Note: See TracChangeset
for help on using the changeset viewer.