Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
Loading...
Searching...
No Matches
srn_engine_t Struct Reference

Engine is a structure to own the long living and main pieces of the compiler. More...

#include <engine.h>

Collaboration diagram for srn_engine_t:
[legend]

Data Fields

_Atomic srn_object_id_t object_id_counter
 An unsigned counter to allocate object ids atomically.
srn_configuration_t config
 The runtime's tunable knobs, the single source for every configurable value (see configuration.h).
srn_mm_tmm
 Memory manager.
srn_scheduler_tscheduler
 The fiber scheduler, that is the entry point of the fiber subsystem.
srn_reactor_treactor
 The I/O reactor, that is in charge of handling everything I/O.
srn_seed_t seed
 We use the seed for hashing and the value will be generated at random for each new context.

Detailed Description

Engine is a structure to own the long living and main pieces of the compiler.

There will be only oe instance of the engine at anytime.

Definition at line 51 of file engine.h.

Field Documentation

◆ config

srn_configuration_t srn_engine_t::config

The runtime's tunable knobs, the single source for every configurable value (see configuration.h).

Held by value, read-only once the engine is up.

Definition at line 62 of file engine.h.

◆ mm

srn_mm_t* srn_engine_t::mm

Memory manager.

Definition at line 65 of file engine.h.

◆ object_id_counter

_Atomic srn_object_id_t srn_engine_t::object_id_counter

An unsigned counter to allocate object ids atomically.

Any object in Serene must have a unique id, this id is not guaranteed to be the same on each run. We use this id as the routing key on the context level to connect different pieces of information related to the same object together. ONLY INTERACT WITH THIS VIA allocate_object_id.

Definition at line 57 of file engine.h.

◆ reactor

srn_reactor_t* srn_engine_t::reactor

The I/O reactor, that is in charge of handling everything I/O.

Definition at line 78 of file engine.h.

◆ scheduler

srn_scheduler_t* srn_engine_t::scheduler

The fiber scheduler, that is the entry point of the fiber subsystem.

It's here so any fiber can reach it through its context as fiber->ctx->engine->scheduler, which is how srn_fiber_ready works from a thread that is not a worker.

Definition at line 75 of file engine.h.

◆ seed

srn_seed_t srn_engine_t::seed

We use the seed for hashing and the value will be generated at random for each new context.

There's concern about hashmap collioson DoS attacks but as far as I can see other compilers are doing a similar thing with a non-cryptographic hashing function. we use xxHash but others are using the non-cryptographic version of SipHash with a random seed as well.

Definition at line 86 of file engine.h.


The documentation for this struct was generated from the following file: