Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
Go to the documentation of this file.
8 #ifndef CORE_SERVER_TASK_INCLUDE_ASYNC_TASKS_MANAGER_H_
9 #define CORE_SERVER_TASK_INCLUDE_ASYNC_TASKS_MANAGER_H_
void PrepareAsyncTasksManager(AsyncTasksManager *manager_p, const int32 initial_counter_value)
Perform the required functionality prior to running an AsyncTasksManager's AsyncTasks.
void * atm_cleanup_data_p
The data to be passed to atm_cleanup_fn when this AsyncTaskManager's tasks have finished and any requ...
Definition: async_tasks_manager.h:63
bool atm_in_use_flag
This shows whether the AsyncTasksManager has any AsyncTasks currently running.
Definition: async_tasks_manager.h:68
void FreeAsyncTasksManagerEventConsumer(AsyncTasksManagerEventConsumer *consumer_p)
Free an AsyncTasksManagerEventConsumer.
MEM_FLAG
An enum specifying the particular status of a piece of dynamically allocated memory for a particular ...
Definition: memory_allocations.h:38
A datatype to represent a running task.
Definition: service_job.h:72
bool AddAsyncTaskToAsyncTasksManager(AsyncTasksManager *manager_p, AsyncTask *task_p, MEM_FLAG mem)
Add an AsyncTask to a AsyncTasksManager.
SyncData * atm_sync_p
The SyncData used by the AsyncTasksManager to coordinate access across the differing threads.
Definition: async_tasks_manager.h:33
bool(* atm_cleanup_fn)(void *data_p)
This is the callback function that be called when this AsyncTaskManager's tasks have finished and any...
Definition: async_tasks_manager.h:57
struct CountAsyncTask * atm_monitor_p
The CountAsyncTask that keeps the count of how many of the AsyncTasksManager's AsyncTasks have been c...
Definition: async_tasks_manager.h:41
struct AsyncTasksManagerEventConsumer * atm_consumer_p
The EventConsumer to call when all of this AsyncTasksManager's AsyncTasks have been completed.
Definition: async_tasks_manager.h:47
AsyncTasksManager * AllocateAsyncTasksManager(const char *const name_s, bool(*cleanup_fn)(void *data_p), void *cleanup_data_p)
Allocate an AsyncTasksManager with the given name.
AsyncTasksManager * atmec_tasks_manager_p
The AsyncTasksManager that owns this AsyncTasksManagerEventConsumer.
Definition: async_tasks_manager.h:82
A datatype that has an EventConsumer and a pointer to the AsyncTasksManager that owns it.
Definition: async_tasks_manager.h:76
A datatype for an AsyncTask that has a counter that sends a signal when that counter reaches a given ...
Definition: count_async_task.h:23
void IncrementAsyncTaskManagerCount(AsyncTasksManager *manager_p)
Notify the AsyncTasksManager that one of its AsyncTasks has finished.
A datatype to use to run tasks asynchronously.
Definition: async_task.h:25
AsyncTasksManagerEventConsumer * AllocateAsyncTasksManagerEventConsumer(void(*consumer_fn)(EventConsumer *consumer_p, struct AsyncTask *task_p), AsyncTasksManager *manager_p)
Create a new AsyncTasksManagerEventConsumer and store it in the given AsyncTasksManager.
bool StartAsyncTaskManagerWorkers(AsyncTasksManager *manager_p)
Start all AsyncTasks within an AsyncTasksManager.
#define GRASSROOTS_TASK_API
Definition: grassroots_task_library.h:46
A doubly-linked list that can be traversed in either direction.
Definition: linked_list.h:56
bool RunAsyncTasksManagerTasks(AsyncTasksManager *manager_p)
Run all AsyncTasks within an AsyncTasksManager.
A datatype that allows data to be shared between tasks (e.g.
Definition: linux_sync_data.h:30
A datatype for storing AsyncTasks in a collection.
Definition: async_tasks_manager.h:24
bool IsAsyncTaskManagerRunning(const AsyncTasksManager *manager_p)
Check whether an AsyncTasksManager has any AsyncTasks currently running,.
An EvenetConsumer is a datatype to allow an object to be notified when an AsyncTask has completed run...
Definition: event_consumer.h:44
A datatype to allow the running of command-line applications in a separate task.
Definition: system_async_task.h:44
SystemAsyncTask * AllocateSystemAsyncTaskFromAsyncTasksManager(AsyncTasksManager *manager_p, ServiceJob *std_service_job_p, char *std_command_line_s, void(*on_success_callback_fn)(ServiceJob *job_p))
Allocate a SystemAsyncTask and add it a given AsyncTasksManager.
EventConsumer atmec_base_consumer
The EventConsumer.
Definition: async_tasks_manager.h:79
LinkedList * atm_tasks_p
LinkedList of AsyncTaskNodes for storing the AsyncTasks.
Definition: async_tasks_manager.h:27
void FreeAsyncTasksManager(AsyncTasksManager *manager_p)
Free an AsyncTasksManager.