SE-304 (structured concurrency) describes the requirements for "exclusive" executors, which were then renamed to "serial" executors some time around SE-306 (actors) and ultimately exposed as the
SerialExecutor protocol in SE-392 (custom actor executors).
The requirements have remained the same as far as I could tell:
- execution must follow a total order on serial / exclusive executors
Does the runtime itself actually depends on the latter property, or is that requirement in place just to guarantee actor isolation semantics?
In other words, could I use a private "serial" executor that does not offer the second property IF the actors using it only contain concurrent-safe structures (e.g. Atomics or otherwise data protected by locks)? I get that it's not really an "actor" in this case, but custom executors can't really exist outside of actors yet.
My use case is to have an async / await interface, while avoiding thread hopping by using a pool of naive "run synchronously on calling thread" executors
This would presumably be a temporary workaround (famous last words) until the "Executor Switching" proposal mentioned at the end of 392 gets ironed out.