reactor-c 1.0
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
scheduler_instance.h File Reference

Common scheduler parameters. More...

#include <stdbool.h>
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  lf_scheduler_t
 Parameters used in schedulers of the threaded reactor C runtime. More...
struct  sched_params_t
 Struct representing the most common scheduler parameters. More...

Macros

#define DEFAULT_MAX_REACTION_LEVEL   100
#define NUMBER_OF_WORKERS   1

Typedefs

typedef struct custom_scheduler_data_t custom_scheduler_data_t
typedef struct lf_scheduler_t lf_scheduler_t
 Parameters used in schedulers of the threaded reactor C runtime.

Functions

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.

Detailed Description

Common scheduler parameters.

Author
Soroush Bateni
Edward A. Lee

This file defines data types and functions that are common across multiple schedulers.

Macro Definition Documentation

◆ DEFAULT_MAX_REACTION_LEVEL

#define DEFAULT_MAX_REACTION_LEVEL   100

◆ NUMBER_OF_WORKERS

#define NUMBER_OF_WORKERS   1

Typedef Documentation

◆ custom_scheduler_data_t

Function Documentation

◆ init_sched_instance()

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.

This is a no-op if instance is already initialized (i.e., not NULL). This function assumes that mutex is allowed to be recursively locked.

Parameters
envThe environment to initialize the scheduler for.
instanceThe lf_scheduler_t object to initialize.
number_of_workersThe number of workers in the program.
paramsReference to scheduler parameters in the form of a sched_params_t. This can be NULL.
Returns
true if initialization was performed. false if instance is already initialized (checked in a thread-safe way).