usputinfo man page on IRIX

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



USGETINFO(3P)							 USGETINFO(3P)

NAME
     usgetinfo, usputinfo, uscasinfo - exchange information though an arena

C SYNOPSIS
     #include <ulocks.h>

     void usputinfo (usptr_t *handle, void *info);

     void *usgetinfo (usptr_t *handle);

     int uscasinfo (usptr_t *handle, void *old, void *new);

DESCRIPTION
     When unrelated processes decide to share an arena, it is often useful to
     be able to initially communicate the location of various data structures
     within the arena.	A single word (doubleword in 64 bit mode)
     communication area is available inside the arena header block, accessible
     via the functions usgetinfo and usputinfo.	 Thus, a process that sets up
     the arena can initialize various locks, semaphores, and common data
     structures, and place a single pointer that any process that joins the
     arena can retrieve.  usputinfo places the data item in the header,
     overwriting any existing information there.  usgetinfo will retrieve that
     information.  At arena creation time, the value is initialized to zero.

     If multiple unrelated processes are starting at arbitrary times, then a
     race condition exists between initializing the arena and setting the
     global information.  The uscasinfo function provides a compare and swap
     operation on the data item in the arena header block.  To establish race
     free initialization, each joining member should first check the data item
     using usgetinfo and if 0 should allocate a semaphore (using usnewsema).
     The caller should then use uscasinfo to atomically place the semaphore
     pointer into the communication area.  If uscasinfo returns 0 then someone
     else may have beat the caller and the caller should free the semaphore
     and repeat the algorithm starting with re-checking usgetinfo.  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.	 If 1
     is returned, then the caller has won and can use the semaphore for future
     negotiation.

SEE ALSO
     usinit(3P).

									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