reactor-c 1.0
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
scheduler_instance.h
Go to the documentation of this file.
1
11
12#ifndef LF_SCHEDULER_PARAMS_H
13#define LF_SCHEDULER_PARAMS_H
14
15#ifndef NUMBER_OF_WORKERS // Enable thread-related platform functions
16#define NUMBER_OF_WORKERS 1
17#endif // NUMBER_OF_WORKERS
18
19#include <stdbool.h>
20#include <stddef.h> // for size_t
21
22#define DEFAULT_MAX_REACTION_LEVEL 100
23
24// Forward declarations
25typedef struct environment_t environment_t;
27
84
109
124bool init_sched_instance(struct environment_t* env, lf_scheduler_t** instance, size_t number_of_workers,
125 sched_params_t* params);
126
127#endif // LF_SCHEDULER_PARAMS_H
struct custom_scheduler_data_t custom_scheduler_data_t
Definition scheduler_instance.h:26
bool init_sched_instance(struct environment_t *env, lf_scheduler_t **instance, size_t number_of_workers, sched_params_t *params)
Initialize instance using the provided information.
Execution environment.
Definition environment.h:52
Parameters used in schedulers of the threaded reactor C runtime.
Definition scheduler_instance.h:35
volatile size_t number_of_idle_workers
Number of workers that are idle.
Definition scheduler_instance.h:74
size_t number_of_workers
Number of workers that this scheduler is managing.
Definition scheduler_instance.h:67
struct environment_t * env
Pointer to the environment.
Definition scheduler_instance.h:39
size_t max_reaction_level
Maximum number of levels for reactions in the program.
Definition scheduler_instance.h:44
volatile int * indexes
An array of atomic indexes.
Definition scheduler_instance.h:57
volatile bool should_stop
Indicate whether the program should stop.
Definition scheduler_instance.h:49
custom_scheduler_data_t * custom_data
Pointer to an optional custom data structure that each scheduler can define.
Definition scheduler_instance.h:82
void * transfer_reactions
Hold reactions temporarily.
Definition scheduler_instance.h:62
Struct representing the most common scheduler parameters.
Definition scheduler_instance.h:89
size_t num_reactions_per_level_size
The size of the num_reactions_per_level array.
Definition scheduler_instance.h:107
size_t * num_reactions_per_level
An array of non-negative integers, where each element represents a reaction level.
Definition scheduler_instance.h:99