Skip to content

no mutex in Batch#115

Open
c-cube wants to merge 94 commits intomainfrom
simon/no-mutex-in-batch-2025-12-01
Open

no mutex in Batch#115
c-cube wants to merge 94 commits intomainfrom
simon/no-mutex-in-batch-2025-12-01

Conversation

@c-cube
Copy link
Copy Markdown
Collaborator

@c-cube c-cube commented Dec 2, 2025

using a mutex is heavy for situations that are (mostly) single threaded, such as
Lwt or Eio backends. Using atomics should be good enough, and degrades to a simple ref
under OCaml 4.

@c-cube c-cube force-pushed the simon/no-mutex-in-batch-2025-12-01 branch from 72b0662 to db2b2b8 Compare December 2, 2025 04:46
c-cube added 29 commits December 3, 2025 13:23
follow more closely the official OTEL recommendations, and also try
to reduce global state.

- use a class type for `Exporter.t` (instead of 1st class module `backend`)
- have tracer, logger, metrics_emitter as explicit objects
- keep a `Main_exporter` to make migration easier, but discouraged
- add stdout_exporter and debug_exporter to opentelemetry.client
now we modify batches on the fly when we send signals; but there
still is a thread pool to send signals via HTTP.
now that fields are mutable, it's cheaper and easier
we have a new explicit `Storage.t` interface, that can be used to
get a `Context.t` (a hmap) and to locally swap it; then we have multiple
implementations of the Storage; and then we have a singleton atomic
containing the "main" storage.
a bit like a buffered writer for any data
@c-cube c-cube force-pushed the simon/no-mutex-in-batch-2025-12-01 branch from db2b2b8 to f542750 Compare December 8, 2025 16:13
this should result in lower overhead for single threaded situations such
as lwt or eio.
@c-cube c-cube force-pushed the simon/no-mutex-in-batch-2025-12-01 branch from f542750 to 107e173 Compare December 8, 2025 16:16
@c-cube c-cube force-pushed the main branch 7 times, most recently from e939ad7 to 6a46859 Compare April 3, 2026 13:26
@c-cube c-cube force-pushed the main branch 2 times, most recently from 3494f6c to 5065cdd Compare April 23, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant