JOCL v2.6.0-rc-20250722
JOCL, OpenCL® API Binding for Java™ (public API).
com.jogamp.opencl.util.MultiQueueBarrier Class Reference

An utility for synchronizing multiple concurrent CLCommandQueues. More...

Collaboration diagram for com.jogamp.opencl.util.MultiQueueBarrier:

Public Member Functions

 MultiQueueBarrier (final int queueCount)
 Creates a new MultiQueueBarrier with the given queueCount. More...
 
 MultiQueueBarrier (final CLCommandQueue... allowedQueues)
 Creates a new MultiQueueBarrier for the given queues. More...
 
MultiQueueBarrier waitFor (final CLCommandQueue queue)
 Blocks the current Thread until all commands on the CLCommandQueue finished excecution. More...
 
MultiQueueBarrier waitFor (final CLCommandQueue queue, final CLEventList events)
 Blocks the current Thread until the given events on the CLCommandQueue occurred. More...
 
MultiQueueBarrier await () throws InterruptedException
 Blocks until all Threads which called waitFor continue execution. More...
 
boolean await (final long timeout, final TimeUnit unit) throws InterruptedException
 
void resetBarrier ()
 Resets this barrier and unblocks all waiting threads. More...
 
long getCount ()
 Returns the current number of events which must occure before this barrier unblocks the waiting threads. More...
 

Detailed Description

An utility for synchronizing multiple concurrent CLCommandQueues.

This Barrier can be reused after it has been broken.

Author
Michael Bien

Definition at line 44 of file MultiQueueBarrier.java.

Constructor & Destructor Documentation

◆ MultiQueueBarrier() [1/2]

com.jogamp.opencl.util.MultiQueueBarrier.MultiQueueBarrier ( final int  queueCount)

Creates a new MultiQueueBarrier with the given queueCount.

It is recommented to use MultiQueueBarrier(CLCommandQueue... allowedQueues) if possible which restricts the set of allowed queues for the barrier.

Definition at line 55 of file MultiQueueBarrier.java.

◆ MultiQueueBarrier() [2/2]

com.jogamp.opencl.util.MultiQueueBarrier.MultiQueueBarrier ( final CLCommandQueue...  allowedQueues)

Creates a new MultiQueueBarrier for the given queues.

Definition at line 67 of file MultiQueueBarrier.java.

Member Function Documentation

◆ await() [1/2]

MultiQueueBarrier com.jogamp.opencl.util.MultiQueueBarrier.await ( ) throws InterruptedException

Blocks until all Threads which called waitFor continue execution.

This method blocks only once, all subsequent calls are ignored.

Definition at line 116 of file MultiQueueBarrier.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ await() [2/2]

boolean com.jogamp.opencl.util.MultiQueueBarrier.await ( final long  timeout,
final TimeUnit  unit 
) throws InterruptedException
See also
await()
Parameters
timeoutthe maximum time to wait
unitthe time unit of the timeout argument

Definition at line 127 of file MultiQueueBarrier.java.

◆ getCount()

long com.jogamp.opencl.util.MultiQueueBarrier.getCount ( )

Returns the current number of events which must occure before this barrier unblocks the waiting threads.

This method is typically used for debugging and testing purposes.

Definition at line 159 of file MultiQueueBarrier.java.

◆ resetBarrier()

void com.jogamp.opencl.util.MultiQueueBarrier.resetBarrier ( )

Resets this barrier and unblocks all waiting threads.

Definition at line 136 of file MultiQueueBarrier.java.

◆ waitFor() [1/2]

MultiQueueBarrier com.jogamp.opencl.util.MultiQueueBarrier.waitFor ( final CLCommandQueue  queue)

Blocks the current Thread until all commands on the CLCommandQueue finished excecution.

This method may be invoked concurrently without synchronization on the MultiQueueBarrier object as long each Thread passes a distinct CLCommandQueue as parameter to this method.

Definition at line 86 of file MultiQueueBarrier.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ waitFor() [2/2]

MultiQueueBarrier com.jogamp.opencl.util.MultiQueueBarrier.waitFor ( final CLCommandQueue  queue,
final CLEventList  events 
)

Blocks the current Thread until the given events on the CLCommandQueue occurred.

This method may be invoked concurrently without synchronization on the MultiQueueBarrier object as long each Thread passes a distinct CLCommandQueue as parameter to this method.

Definition at line 101 of file MultiQueueBarrier.java.

Here is the call graph for this function:

The documentation for this class was generated from the following file: