ClassesClasses | | Operators

create_barriercreate_barrierCreateBarrierCreateBarrier (Operator)

Name

create_barriercreate_barrierCreateBarrierCreateBarrier — Create a barrier synchronization object.

Signature

create_barrier( : : AttribName, AttribValue, TeamSize : BarrierHandle)

Herror create_barrier(const char* AttribName, const char* AttribValue, const Hlong TeamSize, Hlong* BarrierHandle)

Herror T_create_barrier(const Htuple AttribName, const Htuple AttribValue, const Htuple TeamSize, Htuple* BarrierHandle)

void CreateBarrier(const HTuple& AttribName, const HTuple& AttribValue, const HTuple& TeamSize, HTuple* BarrierHandle)

void HBarrier::HBarrier(const HTuple& AttribName, const HTuple& AttribValue, Hlong TeamSize)

void HBarrier::HBarrier(const HString& AttribName, const HString& AttribValue, Hlong TeamSize)

void HBarrier::HBarrier(const char* AttribName, const char* AttribValue, Hlong TeamSize)

void HBarrier::CreateBarrier(const HTuple& AttribName, const HTuple& AttribValue, Hlong TeamSize)

void HBarrier::CreateBarrier(const HString& AttribName, const HString& AttribValue, Hlong TeamSize)

void HBarrier::CreateBarrier(const char* AttribName, const char* AttribValue, Hlong TeamSize)

static void HOperatorSet.CreateBarrier(HTuple attribName, HTuple attribValue, HTuple teamSize, out HTuple barrierHandle)

public HBarrier(HTuple attribName, HTuple attribValue, int teamSize)

public HBarrier(string attribName, string attribValue, int teamSize)

void HBarrier.CreateBarrier(HTuple attribName, HTuple attribValue, int teamSize)

void HBarrier.CreateBarrier(string attribName, string attribValue, int teamSize)

Description

A barrier is a synchronization object blocking a thread until a previous defined number of threads have reached this barrier. create_barriercreate_barrierCreateBarrierCreateBarrierCreateBarrier allocates and initializes the barrier object returned in BarrierHandleBarrierHandleBarrierHandleBarrierHandlebarrierHandle according to the attributes specified in AttribNameAttribNameAttribNameAttribNameattribName and AttribValueAttribValueAttribValueAttribValueattribValue. AttribNameAttribNameAttribNameAttribNameattribName specifies the attribute class and AttribValueAttribValueAttribValueAttribValueattribValue the kind of the barrier. The description beneath lists all barrier kinds supported by following parameter classes:

''""""""""

empty string sets the default attributes.

'type'"type""type""type""type"

specifies what happens if a thread waits at a barrier:

'sleep'"sleep""sleep""sleep""sleep"

simply suspends the calling thread (default).

'spin'"spin""spin""spin""spin"

a fast barrier implementation for short waits that waits busy.

The TeamSizeTeamSizeTeamSizeTeamSizeteamSize argument specifies the number of threads that must call wait_barrierwait_barrierWaitBarrierWaitBarrierWaitBarrier before any of them successfully return from waiting. The value hold in TeamSizeTeamSizeTeamSizeTeamSizeteamSize must be greater than zero.

Execution Information

Parameters

AttribNameAttribNameAttribNameAttribNameattribName (input_control)  number(-array) HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Barrier attribute.

Default value: []

List of values: 'type'"type""type""type""type"

AttribValueAttribValueAttribValueAttribValueattribValue (input_control)  number(-array) HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Barrier attribute value.

Number of elements: AttribValue == AttribName

Default value: []

List of values: 'sleep'"sleep""sleep""sleep""sleep", 'spin'"spin""spin""spin""spin"

TeamSizeTeamSizeTeamSizeTeamSizeteamSize (input_control)  number HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Barrier team size.

Default value: 1

BarrierHandleBarrierHandleBarrierHandleBarrierHandlebarrierHandle (output_control)  barrier HBarrier, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Barrier synchronization object.

Result

create_barriercreate_barrierCreateBarrierCreateBarrierCreateBarrier returns 2 (H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Possible Successors

wait_barrierwait_barrierWaitBarrierWaitBarrierWaitBarrier, clear_barrierclear_barrierClearBarrierClearBarrierClearBarrier

Module

Foundation


ClassesClasses | | Operators