atomic_ops man page on Solaris

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
Solaris logo
[printable version]

atomic_ops(3C)		 Standard C Library Functions		atomic_ops(3C)

NAME
       atomic_ops - atomic operations

SYNOPSIS
       #include <atomic.h>

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

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

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

       atomic_bits(3C) These functions provide atomic bit setting and clearing
		       within a variable.

       atomic_cas(3C)  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(3C)  These functions provide an atomic decrement on a	 vari‐
		       able.

       atomic_inc(3C)  These  functions provide an atomic increment on a vari‐
		       able.

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

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

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

       ┌─────────────────────────────┬─────────────────────────────┐
       │      ATTRIBUTE TYPE	     │	    ATTRIBUTE VALUE	   │
       ├─────────────────────────────┼─────────────────────────────┤
       │Interface Stability	     │Stable			   │
       ├─────────────────────────────┼─────────────────────────────┤
       │MT-Level		     │MT-Safe			   │
       └─────────────────────────────┴─────────────────────────────┘

SEE ALSO
       atomic_add(3C),	 atomic_and(3C),   atomic_bits(3C),    atomic_cas(3C),
       atomic_dec(3C),	atomic_inc(3C),	 atomic_or(3C),	 atomic_swap(3C), mem‐
       bar_ops(3C), attributes(5)

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  synchro‐
       nized  with  the completion of the atomic instruction. If such synchro‐
       nization is required, memory barrier instructions  must	be  used.  See
       membar_ops(3C).

       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
       incremented  rather  than using the atomic_inc(3C) operation on each of
       them.

SunOS 5.10			  12 Aug 2004			atomic_ops(3C)
[top]

List of man pages available for Solaris

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net