Introduce cooperative multitasking module which allows us to interleave important processing with long running tasks while avoiding the additional resource consumption of threads and complexity of asynchronous state machines.
We will use this module to ensure long running processing in the OVSDB server does not interfere with stable maintenance of the RAFT cluster in subsequent patches. Relevant discussion: https://mail.openvswitch.org/pipermail/ovs-discuss/2022-December/052140.html https://mail.openvswitch.org/pipermail/ovs-dev/2023-December/410262.html Frode Nordahl (6): timeval: Make timewarp available for internal callers. lib: Introduce cooperative multitasking module. ovsdb/raft: Register for cooperative multitasking. json: Add yielding json object create/destroy functions. ovsdb-server: Do storage run at top of main loop. ovsdb-server: Make use of cooperative multitasking. NEWS | 8 + include/openvswitch/json.h | 16 +- lib/automake.mk | 3 + lib/cooperative-multitasking-private.h | 31 +++ lib/cooperative-multitasking.c | 195 +++++++++++++++++++ lib/cooperative-multitasking.h | 42 ++++ lib/json.c | 63 ++++-- lib/timeval.c | 56 ++++-- lib/timeval.h | 4 + ovsdb/file.c | 2 + ovsdb/jsonrpc-server.c | 2 + ovsdb/monitor.c | 12 +- ovsdb/ovsdb-server.c | 61 +++--- ovsdb/raft.c | 19 +- ovsdb/trigger.c | 3 + tests/automake.mk | 1 + tests/library.at | 10 + tests/ovsdb-server.at | 1 + tests/test-cooperative-multitasking.c | 259 +++++++++++++++++++++++++ 19 files changed, 721 insertions(+), 67 deletions(-) create mode 100644 lib/cooperative-multitasking-private.h create mode 100644 lib/cooperative-multitasking.c create mode 100644 lib/cooperative-multitasking.h create mode 100644 tests/test-cooperative-multitasking.c -- 2.34.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
