uscas32 man page on IRIX

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



USCAS(3P)							     USCAS(3P)

NAME
     uscas, uscas32 - compare and swap operator

C SYNOPSIS
     #include <ulocks.h>

     int  uscas(void *destp, ptrdiff_t old, ptrdiff_t new, usptr_t *u);
     int  uscas32(void *destp, int32_t old, int32_t new, usptr_t *u);

DESCRIPTION
     uscas emulates a hardware compare and swap instruction.  It works on both
     single and multi-processor machines.  The exact algorithm used depends on
     the chip and system type.	uscas checks that the contents of destp are
     equal to old and if they are, atomically changes the contents of destp to
     new.  If the contents are not the same, a zero is returned and the
     operation may be repeated.	 Note that even with one process performing
     this algorithm, the compare and swap operation may fail, so the caller
     must always be prepared to loop.  u points to a previously set up arena
     (using usinit(3P)).

     uscas does a compare and swap on 32-bits for 32-bit processes and 64-bits
     for 64-bit processes.
     uscas32 does a compare and swap on 32-bits regardless of the type of the
     process.

SEE ALSO
     acquire_lock(3), usinit(3P), ussetlock(3P), uspsema(3P).

DIAGNOSTICS
     A value of 1 returned when a successful compare and swap has been
     performed.	 Otherwise 0 is returned.  There are no errors.

									Page 1

[top]

List of man pages available for IRIX

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