Serene Runtime 1.0.0
C runtime for the Serene programming language
Loading...
Searching...
No Matches
reactor.h
Go to the documentation of this file.
1/* -*- C -*-
2 * Serene programming language
3 * Copyright (C) 2019-2026 Sameer Rahmani <[email protected]>
4 *
5 * This library is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19#pragma once
20
21#include <stddef.h>
22
23typedef struct srn_engine_t srn_engine_t;
25
26/* typedef struct srn_reactor_t { */
27/* // Just a back ref to the engine */
28/* srn_engine_t *engine; */
29
30/* // The chosen backend based on platfrom and so on. */
31/* // `state` is that backend's private data */
32/* const srn_reactor_backend_t *backend; */
33/* void *backend_state; */
34
35/* // Outstanding ops: submitted, not yet completed. The worker loop reads
36 * this */
37/* // to decide what to do when the ready queue drains -- inflight > 0 means
38 */
39/* // "poll the reactor and wait for IO," zero means "truly idle, exit." */
40/* size_t inflight; */
41/* } srn_reactor_t; */
42
43/* // The backend interface */
44/* typedef struct srn_reactor_backend { */
45/* const char *name; */
46/* bool (*init)(srn_reactor_t *); // false => unavailable, try the next */
47/* void (*shutdown)(srn_reactor_t *); */
48/* srn_io_status (*submit)(srn_reactor_t *, srn_io_req *); */
49/* void (*poll)(srn_reactor_t *); */
50/* } srn_reactor_backend; */
51
52/* [[nodiscard]] [[gnu::nonnull(1)]] srn_reactor_t * */
53/* srn_reactor_init(srn_engine_t *engine); */
struct srn_reactor_backend_t srn_reactor_backend_t
Definition reactor.h:24
Engine is a structure to own the long living and main pieces of the compiler.
Definition engine.h:49