Ignore:
Timestamp:
Oct 4, 2018, 11:16:13 PM (3 years ago)
Author:
alain
Message:

Complete restructuration of kernel spinlocks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/remote_barrier.h

    r457 r563  
    11/*
    2  * remote_barrier.h - Access a POSIX barrier.               
     2 * remote_barrier.h - POSIX barrier definition.               
    33 *
    4  * Author  Alain Greiner (2016)
     4 * Author  Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    2727#include <kernel_config.h>
    2828#include <hal_kernel_types.h>
    29 #include <remote_spinlock.h>
     29#include <remote_busylock.h>
    3030#include <xlist.h>
    3131
     
    3333 *          This file defines a POSIX compliant barrier.
    3434 *
    35  * It is used by multi-threaded applications to synchronise threads running in
    36  * different clusters, as all access functions uses hal_remote_lw() / hal_remote_sw()
    37  * portable remote 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.
    3838 *
    3939 * A barrier is declared by a given user process as a "pthread_barrier_t" global variable.
     
    5050 * is blocked on the THREAD_BLOCKED_USERSYNC condition. The last arrived thread
    5151 * 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 the
    55  * remote_barrier() function does not require barrier initialisation, when the barrier
    56  * is statically allocated by the compiler in the kdata segment.
    5752 * **************************************************************************************/
    5853
     
    6661typedef struct remote_barrier_s
    6762{
    68     remote_spinlock_t  lock;          /*! lock protecting list of arrived threads       */
     63    remote_busylock_t  lock;          /*! lock protecting xlist of arrived threads      */
    6964    intptr_t           ident;         /*! virtual address in user space == identifier   */
    7065    uint32_t           current;       /*! number of arrived threads                     */
     
    7570}
    7671remote_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 );
    8872
    8973
Note: See TracChangeset for help on using the changeset viewer.