Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
Loading...
Searching...
No Matches
backend.h File Reference

Internal reactor backend interface. More...

#include <stdbool.h>
#include <stdint.h>
#include "serene/rt/errors.h"
#include "serene/rt/reactor.h"
Include dependency graph for backend.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  srn_reactor_backend_t
 One async system behind the reactor contract. More...

Macros

#define SRN_REACTOR_BACKEND_FEAT_NONE   0
 No declared capabilities.
#define SRN_REACTOR_BACKEND_FEAT_FILE_OFFLOAD   1U
 The backend cannot wait on regular file readiness, so the core serves regular file READ and WRITE off the backend, a synchronous syscall on the calling worker (a dedicated blocking thread pool is the planned replacement).

Typedefs

typedef struct srn_reactor_backend_t srn_reactor_backend_t
 One async system behind the reactor contract.

Variables

const srn_reactor_backend_t srn_reactor_backend_epoll

Detailed Description

Internal reactor backend interface.

A backend is a set of functions that realises the completion based reactor contract: epoll, or io_uring backends on Linux, kqueue or IOCP and so on. Each backend lives in its own platform specific file under rt/reactor/backend/ and exposes a single vtable instance. The reactor core selects one at activation.

Definition in file backend.h.

Macro Definition Documentation

◆ SRN_REACTOR_BACKEND_FEAT_FILE_OFFLOAD

#define SRN_REACTOR_BACKEND_FEAT_FILE_OFFLOAD   1U

The backend cannot wait on regular file readiness, so the core serves regular file READ and WRITE off the backend, a synchronous syscall on the calling worker (a dedicated blocking thread pool is the planned replacement).

Readiness backends (likes of epoll, kqueue) set this; completion backends (likes of io_uring, IOCP) submit file IO natively and leave it clear.

Definition at line 49 of file backend.h.

◆ SRN_REACTOR_BACKEND_FEAT_NONE

#define SRN_REACTOR_BACKEND_FEAT_NONE   0

No declared capabilities.

Definition at line 39 of file backend.h.

Typedef Documentation

◆ srn_reactor_backend_t

typedef struct srn_reactor_backend_t srn_reactor_backend_t

One async system behind the reactor contract.

The reactor core drives these on the reactor thread.

Variable Documentation

◆ srn_reactor_backend_epoll

const srn_reactor_backend_t srn_reactor_backend_epoll
extern