July 11, 2026, 12:13pm 1
Just to clean mess in my head.
Let’s suppose that we have two “execution contexts”:
-
under Io.Threaded
-
under Io.Evented
And shared struct with Io.Mutex used guard
As far as I understand the way of safely access to this struct is
- use “neitral” 3rd Io - std.Io.Threaded.global_single_threaded
Or I miss something?
And this problem simply doesn’t exist
lalinsky July 11, 2026, 12:24pm 2
Use zio, as the evented io, for communicating with the evented io from threaded io, and also for debug_io. std.Io.Mutex used through zio will work no matter if you are in zio’s runtime or any other thread.
g41797 July 11, 2026, 12:26pm 3
does it mean , that it depends on Io implementation?
vulpesx July 11, 2026, 12:27pm 4
If you don’t know the implementations that share the data, then you do need some synchronisation that works across them, which could be another Io though, know that only Threaded qualifies for that currently (ignoring 3rd party Io).
You could also use something outside any Io implementation. Regardless the synchronisation will never be ideally optimal.
It is also possible that you one, and which, of the existing Io qualifies, you could just use that instead creating/using another.
lalinsky July 11, 2026, 12:28pm 5
Yes, it does. The behavior of everything in Io depends on the implementation
g41797 July 11, 2026, 12:33pm 6
means - simply use one of them (via saving io within struct)?
0 Comments
Log in to join the conversation.No comments yet. Be the first to share your thoughts.