![]() |
STASIS
A pipeline delivery generator
|
#include "core.h"#include "sem.h"#include "timespec.h"#include <signal.h>#include <sys/wait.h>#include <sys/mman.h>#include <fcntl.h>#include <sys/stat.h>#include <math.h>
Go to the source code of this file.
Data Structures | |
| struct | MultiProcessingTimer |
| struct | MultiProcessingTask |
| struct | MultiProcessingPool |
Macros | |
| #define | MP_POOL_TASK_STATUS_INITIAL (-1) |
| A multiprocessing task's initial state (i.e. "FAIL") | |
| #define | MP_POOL_TASK_MAX 1000 |
| Maximum number of multiprocessing tasks STASIS can execute. | |
| #define | MP_POOL_PID_UNUSED 0 |
| Value signifies a process is unused or finished executing. | |
| #define | MP_POOL_FAIL_FAST 1 << 1 |
| Option flags for mp_pool_join() | |
Functions | |
| struct MultiProcessingPool * | mp_pool_init (const char *ident, const char *log_root) |
| struct MultiProcessingTask * | mp_pool_task (struct MultiProcessingPool *pool, const char *ident, char *working_dir, char *cmd) |
| int | mp_pool_join (struct MultiProcessingPool *pool, size_t jobs, size_t flags) |
| void | mp_pool_show_summary (struct MultiProcessingPool *pool) |
| void | mp_pool_free (struct MultiProcessingPool **pool) |
| void mp_pool_free | ( | struct MultiProcessingPool ** | pool | ) |
Release resources allocated by mp_pool_init()
| a | pointer to MultiProcessingPool |

| struct MultiProcessingPool * mp_pool_init | ( | const char * | ident, |
| const char * | log_root ) |
Create a multiprocessing pool
| ident | a name to identify the pool |
| log_root | the path to store program output |

| int mp_pool_join | ( | struct MultiProcessingPool * | pool, |
| size_t | jobs, | ||
| size_t | flags ) |
Execute all tasks in a pool
| pool | a pointer to MultiProcessingPool |
| jobs | the number of processes to spawn at once (for serial execution use 1) |
| flags | option to be OR'd (MP_POOL_FAIL_FAST) |
| void mp_pool_show_summary | ( | struct MultiProcessingPool * | pool | ) |
Show summary of pool tasks
| pool | a pointer to MultiProcessingPool |

| struct MultiProcessingTask * mp_pool_task | ( | struct MultiProcessingPool * | pool, |
| const char * | ident, | ||
| char * | working_dir, | ||
| char * | cmd ) |
Create a multiprocessing pool task
| pool | a pointer to MultiProcessingPool |
| ident | a name to identify the task |
| cmd | a command to execute |
