reactor-c
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
 Paramters used in schedulers of the threaded reactor C runtime. More...
 
struct  sched_params_t
 Struct representing the most common scheduler parameters. More...
 

Macros

#define NUMBER_OF_WORKERS   1
 
#define DEFAULT_MAX_REACTION_LEVEL   100
 

Typedefs

typedef struct lf_scheduler_t lf_scheduler_t
 Paramters 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

◆ lf_scheduler_t

typedef struct lf_scheduler_t lf_scheduler_t

Paramters used in schedulers of the threaded reactor C runtime.

Note
Members of this struct are added based on existing schedulers' needs. These should be expanded to accommodate new schedulers.

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.

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

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