Operator Reference

create_barrierT_create_barrierCreateBarrierCreateBarriercreate_barrier (Operator)

create_barrierT_create_barrierCreateBarrierCreateBarriercreate_barrier — Create a barrier synchronization object.

Signature

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)

def create_barrier(attrib_name: MaybeSequence[Union[int, float, str]], attrib_value: MaybeSequence[Union[int, float, str]], team_size: int) -> HHandle

Description

A barrier is a synchronization object blocking a thread until a previous defined number of threads have reached this barrier. create_barriercreate_barrierCreateBarrierCreateBarriercreate_barrier allocates and initializes the barrier object returned in BarrierHandleBarrierHandleBarrierHandlebarrierHandlebarrier_handle according to the attributes specified in AttribNameAttribNameAttribNameattribNameattrib_name and AttribValueAttribValueAttribValueattribValueattrib_value. AttribNameAttribNameAttribNameattribNameattrib_name specifies the attribute class and AttribValueAttribValueAttribValueattribValueattrib_value 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 TeamSizeTeamSizeTeamSizeteamSizeteam_size argument specifies the number of threads that must call wait_barrierwait_barrierWaitBarrierWaitBarrierwait_barrier before any of them successfully return from waiting. The value hold in TeamSizeTeamSizeTeamSizeteamSizeteam_size must be greater than zero.

Execution Information

  • Multithreading type: independent (runs in parallel even with exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

AttribNameAttribNameAttribNameattribNameattrib_name (input_control)  attribute.name(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Barrier attribute.

Default: []

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

AttribValueAttribValueAttribValueattribValueattrib_value (input_control)  attribute.value(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Barrier attribute value.

Number of elements: AttribValue == AttribName

Default: []

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

TeamSizeTeamSizeTeamSizeteamSizeteam_size (input_control)  number HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Barrier team size.

Default: 1

BarrierHandleBarrierHandleBarrierHandlebarrierHandlebarrier_handle (output_control)  barrier HBarrier, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Barrier synchronization object.

Result

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

Possible Successors

wait_barrierwait_barrierWaitBarrierWaitBarrierwait_barrier, clear_barrierclear_barrierClearBarrierClearBarrierclear_barrier

Module

Foundation