membar_ops(3c) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

membar_ops(3c)

membar_ops(3C)           Standard C Library Functions           membar_ops(3C)

NAME
       membar_ops, membar_enter, membar_exit, membar_producer, membar_consumer
       - memory access synchronization barrier operations

SYNOPSIS
       #include <atomic.h>

       void membar_enter(void);


       void membar_exit(void);


       void membar_producer(void);


       void membar_consumer(void);

DESCRIPTION
       The  membar_enter()  function  is  a generic memory barrier used during
       lock entry. It is placed after the memory operation that  acquires  the
       lock to guarantee that the lock protects its data. No stores from after
       the  memory  barrier  will reach visibility and no loads from after the
       barrier will be resolved before the  lock  acquisition  reaches  global
       visibility.


       The membar_exit() function is a generic memory barrier used during lock
       exit.  It  is placed before the memory operation that releases the lock
       to guarantee that the lock protects its data. All loads and stores  is‐
       sued before the barrier will be resolved before the subsequent lock up‐
       date reaches visibility.


       The membar_enter() and membar_exit() functions are used together to al‐
       low  regions  of code to be in relaxed store order and then ensure that
       the load or store order is maintained at a higher level. They are  use‐
       ful in the implementation of mutex exclusion locks.


       The  membar_producer()  function  arranges for all stores issued before
       this point in the code to reach global  visibility  before  any  stores
       that  follow.  This  is  useful  in producer modules that update a data
       item, then set a flag that it is available. The memory barrier  guaran‐
       tees  that  the  available flag is not visible earlier than the updated
       data, thereby imposing store ordering.


       The membar_consumer() function arranges for  all  loads  issued  before
       this  point  in  the  code to be completed before any subsequent loads.
       This is useful in consumer modules that check if data is available  and
       read  the data. The memory barrier guarantees that the data is not sam‐
       pled until after the available flag has  been  seen,  thereby  imposing
       load ordering.

RETURN VALUES
       No values are returned.

ERRORS
       No errors are defined.

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelMT-Safe


SEE ALSO
       atomic_add(3C),   atomic_and(3C),   atomic_bits(3C),    atomic_cas(3C),
       atomic_dec(3C),    atomic_inc(3C),    atomic_ops(3C),    atomic_or(3C),
       atomic_swap(3C), attributes(7), atomic_ops(9F)

NOTES
       Atomic instructions (see atomic_ops(3C)) ensure  global  visibility  of
       atomically-modified  variables  on completion. In a relaxed store order
       system, this does not guarantee that the visibility of other  variables
       will  be synchronized with the completion of the atomic instruction. If
       such synchronization is required, memory barrier instructions  must  be
       used.

Oracle Solaris 11.4               14 Feb 2005                   membar_ops(3C)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3