Changes between Version 7 and Version 8 of user_synchro


Ignore:
Timestamp:
Oct 9, 2018, 7:24:11 PM (3 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • user_synchro

    v7 v8  
    1818== B) Mutex ==
    1919
    20 The user level, POSIX compliant, '''mutex''' is defined in the '''pthread''' library, implemented by the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libpthread/pthread.h pthread.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libpthread/pthread.c pthread.c] files.
     20The user level, POSIX compliant, mutex is defined in the '''pthread''' library, implemented by the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libpthread/pthread.h pthread.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libpthread/pthread.c pthread.c] files.
    2121
    2222It can be used by a muti-threaded user application to give a thread exclusive access to a shared user object.
     
    3232== C) Condvar ==
    3333
    34 The user level, POSIX compliant, '''condvar''' is defined in the '''pthread''' library, implemented by the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libpthread/pthread.h pthread.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libpthread/pthread.c pthread.c] files.
     34The user level, POSIX compliant, condvar is defined in the '''pthread''' library, implemented by the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libpthread/pthread.h pthread.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libpthread/pthread.c pthread.c] files.
    3535
    3636It allows a given thread  to efficiently wait for a change in a shared user object.
     
    4949== D) Semaphore ==
    5050
    51 The user level, POSIX compliant, '''semaphore''' is defined in the '''semaphore''' library, implemented by the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libsemaphore/semaphore.h semaphore.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libsemaphore/semaphore.c semaphore.c] files.
     51The user level, POSIX compliant, semaphore is defined in the '''semaphore''' library, implemented by the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libsemaphore/semaphore.h semaphore.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libsemaphore/semaphore.c semaphore.c] files.
    5252
    5353It can be used by a muti-threaded user application to synchronize user threads running in different clusters, through the ''wait'' and ''post'' primitives.
     
    6464== E) Barrier ==
    6565
    66 The user level, POSIX compliant, '''barrier''' is defined in the '''pthread''' library, implemented by the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libpthread/pthread.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libpthread/pthread.c pthread.c] files.
     66The user level, POSIX compliant, barrier is defined in the '''pthread''' library, implemented by the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libpthread/pthread.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/libs/libpthread/pthread.c pthread.c] files.
     67
     68It can be used by a muti-threaded user application to implement a "rendez-vous" for a given number of  threads running in different clusters. This toggle barrier can be used
     69
     70The kernel implementation of a barrier is defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/libk/remote_barrier.h remote_barrier.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/libk/remote_barrier.c remote_barrier.c] files.
     71
     72For each user barrier, ALMOS-MKH creates a kernel ''remote_barrier_t'' structure, dynamically allocated in the reference cluster (i.e. in the cluster containing the reference process descriptor).
     73 * The '''remote_barrier_create()''' function allocates and initializes a barrier, using an RPC if if the calling thread is not running in the reference cluster.
     74 * The '''remote_barrier_destroy()''' function destroys a given barrier, using RPC if the calling thread is not running in the reference cluster.
     75 * The blocking '''remote_barrier_wait()''' function returns only when the all expected threads (defined by the remote_barrier_create() function) reach the barrier. As the implementation uses a toggle variable, this barrier can be safely called several times, as long as the number of expected threads does not change.