create_barrierT_create_barrierCreateBarrierCreateBarrier (Operator)


create_barrierT_create_barrierCreateBarrierCreateBarrier — Create a barrier synchronization object.


create_barrier( : : AttribName, AttribValue, TeamSize : 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::HBarrier(const wchar_t* AttribName, const wchar_t* AttribValue, Hlong TeamSize)   (Windows only)

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)

void HBarrier::CreateBarrier(const wchar_t* AttribName, const wchar_t* AttribValue, Hlong TeamSize)   (Windows only)

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)


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.


specifies what happens if a thread waits at a barrier:


simply suspends the calling thread (default).


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


AttribNameAttribNameAttribNameAttribNameattribName (input_control) 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)  attribute.value(-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 (handle) (IntPtr) (HHandle) (handle)

Barrier synchronization object.


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