atomic_ops(9f) 맨 페이지 - 윈디하나의 솔라나라

개요

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

atomic_ops(9f)

atomic_ops(9F)                 Kernel Functions                 atomic_ops(9F)

NAME
       atomic_ops - atomic operations

SYNOPSIS
       #include <sys/atomic.h>

DESCRIPTION
       This  collection  of functions provides atomic memory operations. There
       are 8 different classes of atomic operations:

       atomic_add(9F)   These functions provide an atomic addition of a signed
                        value to a variable.


       atomic_and(9F)   These functions provide an atomic logical 'and'  of  a
                        value to a variable.


       atomic_bits(9F)  These  functions provide atomic bit setting and clear‐
                        ing within a variable.


       atomic_cas(9F)   These functions provide  an  atomic  comparison  of  a
                        value  with  a  variable.  If the comparison is equal,
                        then swap in a new value for the  variable,  returning
                        the old value of the variable in either case.


       atomic_dec(9F)   These functions provide an atomic decrement on a vari‐
                        able.


       atomic_inc(9F)   These functions provide an atomic increment on a vari‐
                        able.


       atomic_or(9F)    These  functions  provide  an atomic logical 'or' of a
                        value to a variable.


       atomic_swap(9F)  These functions provide an atomic swap of a value with
                        a variable, returning the old value of the variable.


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


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

NOTES
       Atomic  instructions  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.  See  mem‐
       bar_ops(9F).


       Atomic  instructions  can be expensive. since they require synchroniza‐
       tion to occur at a hardware level. This means they should be used  with
       care  to  ensure  that  forcing hardware level synchronization occurs a
       minimum number of times. For example, if  you  have  several  variables
       that need to be incremented as a group, and each needs to be done atom‐
       ically,  then  do so with a mutex lock protecting all of them being in‐
       cremented rather than using the atomic_inc(9F)  operation  on  each  of
       them.

Oracle Solaris 11.4               28 Mar 2005                   atomic_ops(9F)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3