Changeset 563 for trunk/kernel/libk/remote_barrier.h
- Timestamp:
- Oct 4, 2018, 11:16:13 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/remote_barrier.h
r457 r563 1 1 /* 2 * remote_barrier.h - Access a POSIX barrier.2 * remote_barrier.h - POSIX 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 … … 27 27 #include <kernel_config.h> 28 28 #include <hal_kernel_types.h> 29 #include <remote_ spinlock.h>29 #include <remote_busylock.h> 30 30 #include <xlist.h> 31 31 … … 33 33 * This file defines a POSIX compliant barrier. 34 34 * 35 * It is used by multi-threaded applications to synchronise threads running in36 * different clusters, as all access functions uses hal_remote_l w() / hal_remote_sw()37 * portableremote access primitives.35 * It is used by multi-threaded iuser applications to synchronise threads running in 36 * different clusters, as all access functions uses hal_remote_l32() / hal_remote_s32() 37 * remote access primitives. 38 38 * 39 39 * A barrier is declared by a given user process as a "pthread_barrier_t" global variable. … … 50 50 * is blocked on the THREAD_BLOCKED_USERSYNC condition. The last arrived thread 51 51 * unblocks all registtered waiting threads. 52 *53 * Implementation note:54 * This barrier is also used by the kernel in the parallel kernel_init phase, as the55 * remote_barrier() function does not require barrier initialisation, when the barrier56 * is statically allocated by the compiler in the kdata segment.57 52 * **************************************************************************************/ 58 53 … … 66 61 typedef struct remote_barrier_s 67 62 { 68 remote_ spinlock_t lock; /*! lock protecting list of arrived threads*/63 remote_busylock_t lock; /*! lock protecting xlist of arrived threads */ 69 64 intptr_t ident; /*! virtual address in user space == identifier */ 70 65 uint32_t current; /*! number of arrived threads */ … … 75 70 } 76 71 remote_barrier_t; 77 78 /*****************************************************************************************79 * This function is directly used by the kernel in the kernel_init phase,80 * because it does not require barrier state initialisation.81 * It returns only when the <count> expected threads reach the barrier.82 *****************************************************************************************83 * @ barrier_xp : extended pointer on barrier descriptor.84 * @ count : number of expected threads.85 ****************************************************************************************/86 inline void remote_barrier( xptr_t barrier_xp,87 uint32_t count );88 72 89 73
Note: See TracChangeset
for help on using the changeset viewer.