CoreFlow 1.0.0
A modern orchestration and execution runtime
Loading...
Searching...
No Matches
Internal OSAL API

The Internal Operating System Abstraction Layer API. More...

Classes

struct  vx_value_set_t
 The data object for queues. More...
 
struct  vx_queue_t
 The queue object. More...
 
struct  vx_threadpool_worker_t
 The structure given to each threadpool worker during execution. More...
 
struct  vx_threadpool_t
 The threadpool tracking structure. More...
 
struct  vx_work_t
 The work item to distribute across the threadpools. More...
 
class  coreflow::Osal
 OS Abstraction Layer Utility Class. More...
 

Typedefs

typedef vx_size vx_value_t
 A thread return value.
 
typedef vx_value_t(* vx_thread_f) (void *arg)
 A thread function pointer.
 
typedef vx_bool(* vx_threadpool_f) (struct vx_threadpool_worker_t *worker)
 The function pointer to the worker function.
 

Functions

static vx_bool coreflow::Osal::createSem (vx_sem_t *sem, vx_uint32 count)
 Creates a semaphore object and sets to a given count.
 
static void coreflow::Osal::destroySem (vx_sem_t *sem)
 Releases a semaphore object.
 
static vx_bool coreflow::Osal::semPost (vx_sem_t *sem)
 Posts a semaphore object.
 
static vx_bool coreflow::Osal::semWait (vx_sem_t *sem)
 Waits on a semaphore object.
 
static vx_bool coreflow::Osal::semTryWait (vx_sem_t *sem)
 Tries to wait on a semaphore object.
 
static vx_bool coreflow::Osal::joinThread (vx_thread_t thread, vx_value_t *value)
 Joins a thread.
 
static vx_thread_t coreflow::Osal::createThread (vx_thread_f func, void *arg)
 Creates a thread.
 
static void coreflow::Osal::sleepThread (vx_uint32 milliseconds)
 Sleeps the current thread for a given number of milliseconds.
 
static vx_bool coreflow::Osal::initEvent (vx_internal_event_t *e, vx_bool autoreset)
 Initializes an event.
 
static vx_bool coreflow::Osal::waitEvent (vx_internal_event_t *e, vx_uint32 timeout)
 Waits on an event.
 
static vx_bool coreflow::Osal::setEvent (vx_internal_event_t *e)
 Sets an event.
 
static vx_bool coreflow::Osal::resetEvent (vx_internal_event_t *e)
 Resets an event.
 
static vx_bool coreflow::Osal::waitEventInternal (vx_internal_event_t *e, vx_uint32 ms)
 Wait on an internal event.
 
static vx_bool coreflow::Osal::deinitEvent (vx_internal_event_t *e)
 Deinitializes an event.
 
static vx_threadpool_tcoreflow::Osal::createThreadpool (vx_uint32 numThreads, vx_uint32 numWorkItems, vx_size sizeWorkItem, vx_threadpool_f worker, void *arg)
 Create and allocate thread pool.
 
static vx_bool coreflow::Osal::issueThreadpool (vx_threadpool_t *pool, vx_value_set_t workitems[], uint32_t numWorkItems)
 Start and issue tasks to thread pool.
 
static vx_bool coreflow::Osal::completeThreadpool (vx_threadpool_t *pool, vx_bool blocking)
 Complete and join thread pool.
 
static vx_value_t coreflow::Osal::workerThreadpool (void *arg)
 Launch worker thread pool.
 
static void coreflow::Osal::destroyThreadpool (vx_threadpool_t **ppool)
 Destroy thread pool.
 
static void coreflow::Osal::startCapture (vx_perf_t *perf)
 Starts the performance capture.
 
static void coreflow::Osal::stopCapture (vx_perf_t *perf)
 Stops the performance capture.
 
static vx_float32 coreflow::Osal::timeToMS (vx_uint64 c)
 Converts a vx_uint64 to a float in milliseconds.
 
static void coreflow::Osal::initPerf (vx_perf_t *perf)
 Initializes the performance information.
 
static void coreflow::Osal::printPerf (vx_perf_t *perf)
 Prints the performance information.
 
static void coreflow::Osal::initQueue (vx_queue_t *q)
 Initializes the queue.
 
static vx_queue_tcoreflow::Osal::createQueue ()
 Creates a queue object.
 
vx_queue_tcoreflow::Osal::createQueue (vx_uint32 numItems, vx_size itemSize)
 Creates a queue object of specific size.
 
static vx_bool coreflow::Osal::readQueue (vx_queue_t *q, vx_value_set_t **data)
 Reads from a queue object.
 
static vx_bool coreflow::Osal::writeQueue (vx_queue_t *q, vx_value_set_t *data)
 Writes to a queue object.
 
static void coreflow::Osal::popQueue (vx_queue_t *q)
 Pops a queue object.
 
static void coreflow::Osal::destroyQueue (vx_queue_t **pq)
 Destroys a queue object.
 
static void coreflow::Osal::deinitQueue (vx_queue_t *q)
 Deinitializes a queue object.
 
static void coreflow::Osal::printQueue (vx_queue_t *q)
 Print the queue object.
 
static vx_module_handle_t coreflow::Osal::loadModule (vx_char *name)
 Loads a module.
 
static void coreflow::Osal::unloadModule (vx_module_handle_t mod)
 Unloads a module.
 
static vx_symbol_t coreflow::Osal::getSymbol (vx_module_handle_t mod, const vx_char *name)
 Gets a symbol from a module.
 

Detailed Description

The Internal Operating System Abstraction Layer API.

Typedef Documentation

◆ vx_thread_f

typedef vx_value_t(* vx_thread_f) (void *arg)

#include <vx_internal.h>

A thread function pointer.

◆ vx_threadpool_f

typedef vx_bool(* vx_threadpool_f) (struct vx_threadpool_worker_t *worker)

#include <vx_internal.h>

The function pointer to the worker function.

Parameters
[in]workerThe per-thread worker data structure.
Return values
false_eIndicates that the worker failed to process data or had some other error.

◆ vx_value_t

#include <vx_internal.h>

A thread return value.

Function Documentation

◆ completeThreadpool()

static vx_bool coreflow::Osal::completeThreadpool ( vx_threadpool_t * pool,
vx_bool blocking )
static

#include <vx_osal.h>

Complete and join thread pool.

Parameters
[in]poolThe pointer to the thread pool.
[in]blockingThe flag to block until all threads are done.
Returns
vx_true_e if successful, else vx_false_e.

◆ createQueue() [1/2]

static vx_queue_t * coreflow::Osal::createQueue ( )
static

#include <vx_osal.h>

Creates a queue object.

Returns
The pointer to the queue object.

◆ createQueue() [2/2]

vx_queue_t * coreflow::Osal::createQueue ( vx_uint32 numItems,
vx_size itemSize )

#include <vx_osal.h>

Creates a queue object of specific size.

Parameters
[in]numItemsThe number of items in the queue.
[in]itemSizeThe size of each item in the queue.
Returns
The pointer to the queue object.

◆ createSem()

static vx_bool coreflow::Osal::createSem ( vx_sem_t * sem,
vx_uint32 count )
static

#include <vx_osal.h>

Creates a semaphore object and sets to a given count.

Parameters
[in]semThe pointer to the semaphore object.
[in]countThe count to set the semaphore to.
Returns
vx_true_e if successful, else vx_false_e.

◆ createThread()

static vx_thread_t coreflow::Osal::createThread ( vx_thread_f func,
void * arg )
static

#include <vx_osal.h>

Creates a thread.

Parameters
[in]funcThe function to run in the thread.
[in]argThe argument to pass to the function.
Returns
The thread handle.

◆ createThreadpool()

static vx_threadpool_t * coreflow::Osal::createThreadpool ( vx_uint32 numThreads,
vx_uint32 numWorkItems,
vx_size sizeWorkItem,
vx_threadpool_f worker,
void * arg )
static

#include <vx_osal.h>

Create and allocate thread pool.

Parameters
[in]numThreadsThe number of threads in the pool.
[in]numWorkItemsThe number of work items in the pool.
[in]sizeWorkItemThe size of each work item.
[in]workerThe worker function.
[in]argThe argument to pass to the worker function.
Returns
The pointer to the thread pool.

◆ deinitEvent()

static vx_bool coreflow::Osal::deinitEvent ( vx_internal_event_t * e)
static

#include <vx_osal.h>

Deinitializes an event.

Parameters
[in]eThe pointer to the event object.
Returns
vx_true_e if successful, else vx_false_e.

◆ deinitQueue()

static void coreflow::Osal::deinitQueue ( vx_queue_t * q)
static

#include <vx_osal.h>

Deinitializes a queue object.

Parameters
[in]qThe pointer to the queue object.

◆ destroyQueue()

static void coreflow::Osal::destroyQueue ( vx_queue_t ** pq)
static

#include <vx_osal.h>

Destroys a queue object.

Parameters
[in]pqThe pointer to the queue object.

◆ destroySem()

static void coreflow::Osal::destroySem ( vx_sem_t * sem)
static

#include <vx_osal.h>

Releases a semaphore object.

Parameters
[in]semThe pointer to the semaphore object.

◆ destroyThreadpool()

static void coreflow::Osal::destroyThreadpool ( vx_threadpool_t ** ppool)
static

#include <vx_osal.h>

Destroy thread pool.

Parameters
[in]ppoolThe pointer to the thread pool.

◆ getSymbol()

static vx_symbol_t coreflow::Osal::getSymbol ( vx_module_handle_t mod,
const vx_char * name )
static

#include <vx_osal.h>

Gets a symbol from a module.

Parameters
[in]modThe handle to the module.
[in]nameThe name of the symbol.
Returns
The symbol.

◆ initEvent()

static vx_bool coreflow::Osal::initEvent ( vx_internal_event_t * e,
vx_bool autoreset )
static

#include <vx_osal.h>

Initializes an event.

Parameters
[in]eThe pointer to the event object.
[in]autoresetThe flag to autoreset the event.
Returns
vx_true_e if successful, else vx_false_e.

◆ initPerf()

static void coreflow::Osal::initPerf ( vx_perf_t * perf)
static

#include <vx_osal.h>

Initializes the performance information.

Parameters
[in]perfThe pointer to the performance information.

◆ initQueue()

static void coreflow::Osal::initQueue ( vx_queue_t * q)
static

#include <vx_osal.h>

Initializes the queue.

Parameters
[in]qThe pointer to the queue object.

◆ issueThreadpool()

static vx_bool coreflow::Osal::issueThreadpool ( vx_threadpool_t * pool,
vx_value_set_t workitems[],
uint32_t numWorkItems )
static

#include <vx_osal.h>

Start and issue tasks to thread pool.

Parameters
[in]poolThe pointer to the thread pool.
[in]workitemsThe work items to issue.
[in]numWorkItemsThe number of work items to issue.
Returns
vx_true_e if successful, else vx_false_e.

◆ joinThread()

static vx_bool coreflow::Osal::joinThread ( vx_thread_t thread,
vx_value_t * value )
static

#include <vx_osal.h>

Joins a thread.

Parameters
[in]threadThe thread to join.
[out]valueThe return value of the thread.
Returns
vx_true_e if successful, else vx_false_e.

◆ loadModule()

static vx_module_handle_t coreflow::Osal::loadModule ( vx_char * name)
static

#include <vx_osal.h>

Loads a module.

Parameters
[in]nameThe name of the module.
Returns
The handle to the module.

◆ popQueue()

static void coreflow::Osal::popQueue ( vx_queue_t * q)
static

#include <vx_osal.h>

Pops a queue object.

Parameters
[in]qThe pointer to the queue object.

◆ printPerf()

static void coreflow::Osal::printPerf ( vx_perf_t * perf)
static

#include <vx_osal.h>

Prints the performance information.

Parameters
[in]perfThe pointer to the performance information.

◆ printQueue()

static void coreflow::Osal::printQueue ( vx_queue_t * q)
static

#include <vx_osal.h>

Print the queue object.

Parameters
[in]q

◆ readQueue()

static vx_bool coreflow::Osal::readQueue ( vx_queue_t * q,
vx_value_set_t ** data )
static

#include <vx_osal.h>

Reads from a queue object.

Parameters
[in]qThe pointer to the queue object.
[out]dataThe pointer to the data read.
Returns
vx_true_e if successful, else vx_false_e.

◆ resetEvent()

static vx_bool coreflow::Osal::resetEvent ( vx_internal_event_t * e)
static

#include <vx_osal.h>

Resets an event.

Parameters
[in]eThe pointer to the event object.
Returns
vx_true_e if successful, else vx_false_e.

◆ semPost()

static vx_bool coreflow::Osal::semPost ( vx_sem_t * sem)
static

#include <vx_osal.h>

Posts a semaphore object.

Parameters
[in]semThe pointer to the semaphore object.
Returns
vx_true_e if successful, else vx_false_e.

◆ semTryWait()

static vx_bool coreflow::Osal::semTryWait ( vx_sem_t * sem)
static

#include <vx_osal.h>

Tries to wait on a semaphore object.

Parameters
[in]semThe pointer to the semaphore object.
Returns
vx_true_e if successful, else vx_false_e.

◆ semWait()

static vx_bool coreflow::Osal::semWait ( vx_sem_t * sem)
static

#include <vx_osal.h>

Waits on a semaphore object.

Parameters
[in]semThe pointer to the semaphore object.
Returns
vx_true_e if successful, else vx_false_e.

◆ setEvent()

static vx_bool coreflow::Osal::setEvent ( vx_internal_event_t * e)
static

#include <vx_osal.h>

Sets an event.

Parameters
[in]eThe pointer to the event object.
Returns
vx_true_e if successful, else vx_false_e.

◆ sleepThread()

static void coreflow::Osal::sleepThread ( vx_uint32 milliseconds)
static

#include <vx_osal.h>

Sleeps the current thread for a given number of milliseconds.

Parameters
[in]millisecondsThe number of milliseconds to sleep.

◆ startCapture()

static void coreflow::Osal::startCapture ( vx_perf_t * perf)
static

#include <vx_osal.h>

Starts the performance capture.

Parameters
[in]perfThe pointer to the performance information.

◆ stopCapture()

static void coreflow::Osal::stopCapture ( vx_perf_t * perf)
static

#include <vx_osal.h>

Stops the performance capture.

Parameters
[in]perfThe pointer to the performance information.

◆ timeToMS()

static vx_float32 coreflow::Osal::timeToMS ( vx_uint64 c)
static

#include <vx_osal.h>

Converts a vx_uint64 to a float in milliseconds.

Parameters
[in]cThe time in nanoseconds.
Returns
The time in milliseconds.

◆ unloadModule()

static void coreflow::Osal::unloadModule ( vx_module_handle_t mod)
static

#include <vx_osal.h>

Unloads a module.

Parameters
[in]modThe handle to the module.

◆ waitEvent()

static vx_bool coreflow::Osal::waitEvent ( vx_internal_event_t * e,
vx_uint32 timeout )
static

#include <vx_osal.h>

Waits on an event.

Parameters
[in]eThe pointer to the event object.
[in]timeoutThe timeout in milliseconds.
Returns
vx_true_e if successful, else vx_false_e.

◆ waitEventInternal()

static vx_bool coreflow::Osal::waitEventInternal ( vx_internal_event_t * e,
vx_uint32 ms )
static

#include <vx_osal.h>

Wait on an internal event.

Parameters
eThe pointer to the event object.
msThe timeout in milliseconds.
Returns
vx_bool vx_true_e if successful, else vx_false_e.

◆ workerThreadpool()

static vx_value_t coreflow::Osal::workerThreadpool ( void * arg)
static

#include <vx_osal.h>

Launch worker thread pool.

Parameters
argThe argument to pass to the worker function.
Returns
vx_value_t The return value of the worker function.

◆ writeQueue()

static vx_bool coreflow::Osal::writeQueue ( vx_queue_t * q,
vx_value_set_t * data )
static

#include <vx_osal.h>

Writes to a queue object.

Parameters
[in]qThe pointer to the queue object.
[in]dataThe pointer to the data to write.
Returns
vx_true_e if successful, else vx_false_e.