Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
2.  Remote Shared Memory API for Solaris Clusters API Library Functions Memory Segment Operations Import-Side Memory Segment Operations  Previous   Contents   Next 
   
 
RSMERR_BAD_SEG_HNDL

Invalid segment handle

Barrier Operations

Use Barrier operations to resolve order-of-write-access memory model issues. Barrier operations also provide remote memory access error detection.

The barrier mechanism is made up of the following operations:

  • Initialization

  • Open

  • Close

  • Order

The open and close operations define a span-of-time interval for error detection and ordering. The initialization operation enables barrier creation for each imported segment, as well as barrier type specification. The only barrier type currently supported has a span-of-time scope per segment. Use a type argument value of RSM_BAR_DEFAULT.

Successfully performing a close operation guarantees the successful completion of covered access operations, which take place between the barrier open and the barrier close. After a barrier open operation, failures of individual data access operations, both reads and writes, are not reported until the barrier close operation.

To impose a specific order of write completion within a barrier's scope, use an explicit barrier-order operation. Write operations that are issued before the barrier-order operation complete before operations that are issued after them. All write operations within a given barrier scope are ordered with respect to another barrier scope.

Initialize Barrier

int rsm_memseg_import_init_barrier(rsm_memseg_import_handle_t im_memseg, rsm_barrier_type_t type, rsmapi_barrier_t *barrier);


Note - At present, RSM_BAR_DEFAULT is the only supported type.


Return Values: Returns 0 if successful; returns an error value otherwise.

RSMERR_BAD_SEG_HNDL

Invalid segment handle

RSMERR_BAD_BARRIER_PTR

Invalid barrier pointer

RSMERR_INSUFFICIENT_MEM

Insufficient memory

Open Barrier

int rsm_memseg_import_open_barrier(rsmapi_barrier_t *barrier);

Return Values: Returns 0 if successful; returns an error value otherwise.

RSMERR_BAD_SEG_HNDL

Invalid segment handle

RSMERR_BAD_BARRIER_PTR

Invalid barrier pointer

Close Barrier

int rsm_memseg_import_close_barrier(rsmapi_barrier_t *barrier);

This function closes the barrier and flushes all store buffers. This call assumes the calling process will retry all remote memory operations since the last rsm_memseg_import_open_barrier call if the call to rsm_memseg_import_close_barrier() fails.

Return Values: Returns 0 if successful; returns an error value otherwise.

RSMERR_BAD_SEG_HNDL

Invalid segment handle

RSMERR_BAD_BARRIER_PTR

Invalid barrier pointer

RSMERR_BARRIER_UNINITIALIZED

Barrier not initialized

RSMERR_BARRIER_NOT_OPENED

Barrier not opened

RSMERR_BARRIER_FAILURE

Memory access error

RSMERR_CONN_ABORTED

Connection aborted

Order Barrier

int rsm_memseg_import_order_barrier(rsmapi_barrier_t *barrier);

This function flushes all store buffers.

Return Values: Returns 0 if successful; returns an error value otherwise.

RSMERR_BAD_SEG_HNDL

Invalid segment handle

RSMERR_BAD_BARRIER_PTR

Invalid barrier pointer

RSMERR_BARRIER_UNINITIALIZED

Barrier not initialized

RSMERR_BARRIER_NOT_OPENED

Barrier not opened

RSMERR_BARRIER_FAILURE

Memory access error

RSMERR_CONN_ABORTED

Connection aborted

Destroy Barrier

int rsm_memseg_import_destroy_barrier(rsmapi_barrier_t *barrier);

This function deallocates all barrier resources.

Return Values: Returns 0 if successful; returns an error value otherwise.

RSMERR_BAD_SEG_HNDL

Invalid segment handle

RSMERR_BAD_BARRIER_PTR

Invalid barrier pointer

Set Mode

int rsm_memseg_import_set_mode(rsm_memseg_import_handle_t im_memseg, rsm_barrier_mode_t mode);

This function supports the optional explicit barrier scoping available in the put routines. There are two valid barrier modes: RSM_BARRIER_MODE_EXPLICIT and RSM_BARRIER_MODE_IMPLICIT. The default value of the barrier mode is RSM_BARRIER_MODE_IMPLICIT. While in implicit mode, an implicit barrier open and barrier close is applied to each put operation. Before setting the barrier mode value to RSM_BARRIER_MODE_EXPLICIT, use the rsm_memseg_import_init_barrier routine to initialize a barrier for the imported segment im_memseg.

Return Values: Returns 0 if successful; returns an error value otherwise.

RSMERR_BAD_SEG_HNDL

Invalid segment handle

Get Mode

int rsm_memseg_import_get_mode(rsm_memseg_import_handle_t im_memseg, rsm_barrier_mode_t *mode);

This function obtains the current mode value for barrier scoping in the put routines.

Return Values: Returns 0 if successful; returns an error value otherwise.

 
 
 
  Previous   Contents   Next