Data Structures | Macros | Typedefs | Functions
ai_threads.h File Reference

Multi-platform API for the creation and management of CPU threads. More...

#include "ai_api.h"

Go to the source code of this file.

Data Structures

struct  AtParallelJobs
 Work scheduler structure that can run jobs in parallel. More...
 

Macros

#define AI_MAX_THREADS   1024
 maximum number of threads
 
Thread Priorities
#define AI_PRIORITY_LOWEST   0x00
 even lower priority than AI_PRIORITY_LOW
 
#define AI_PRIORITY_LOW   0x01
 low thread priority
 
#define AI_PRIORITY_NORMAL   0x02
 normal thread priority
 
#define AI_PRIORITY_HIGH   0x03
 high thread priority
 

Typedefs

typedef void(* AtParallelForFunc) (size_t array_index, void *data, void *payload)
 
typedef void * AtParallelJobsID
 
typedef void(* AtParallelJobsFunc) (void *payload)
 

Functions

AI_API void * AiThreadCreate (unsigned int(*fn)(void *), void *data, int priority)
 Creates a thread and returns a handler for the thread. More...
 
AI_API void AiThreadClose (void *thread)
 Closes thread handle, to avoid resource leaks. More...
 
AI_API void AiThreadWait (void *thread)
 Wait for a thread to finish. More...
 
AI_API AI_CONST void * AiThreadSelf ()
 Returns a handle for the current (calling) thread. More...
 
AI_API void AiParallelFor (void *array_of_data, size_t data_size, size_t num_data, void *payload, AtParallelForFunc job)
 Operate on an array of data in parallel. More...
 
AI_API AtParallelJobsID AiParallelJobsCreateID ()
 Create a work scheduler, for running jobs in parallel. More...
 
AI_API void AiParallelJobsDestroy (AtParallelJobsID jobsID)
 Destroy the parallel work scheduler. More...
 
AI_API void AiParallelJobsDispatch (AtParallelJobsID jobsID, void *payload, AtParallelJobsFunc job)
 Run a new job that will be executed in a separate thread. More...
 
AI_API void AiParallelJobsWait (AtParallelJobsID jobsID)
 Wait until all jobs of a given work scheduler have ended. More...
 

Detailed Description

Multi-platform API for the creation and management of CPU threads.


© 2023 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com