-
Notifications
You must be signed in to change notification settings - Fork 46
Description
We should refactor shuttle into a modular structure. Currently, the core runtime, schedulers, standard library primitives, and test utilities are all bundled together. Separating these would make it easier to add support for new libraries (like tokio and parking_lot), improve maintainability, and provide a minimal core focused on tracking dependencies via vector clocks and exposing foundational primitives for building custom synchronization constructs (like atomic-wait requested in #248 ).
We've already started doing this with shuttle-tokio (#238) and shuttle-parking_lot (#232)
Here's a proposed crate structure we could consider (credit due to @sarsko and @Aurel300 who came up with most of this):
-
shuttle-core
- trait
Scheduler- do we need
dfshere too, for running tests forshuttle-core?
- do we need
- Runtime, execution state, vector clocks
- a core primitive that all other primitives (like
Mutex,mpscchannels etc) can be built on top of- currently, this is
BatchSemaphore, but we should consider making an even more foundational primitive that is smaller, easier to maintain, and supports building things likeatomic-wait
- currently, this is
- trait
-
shuttle-schedulers
- put all the specific schedulers here (Random, Pct, URW, ...)
-
shuttle-sync
- all the
std::syncreplacement primitives
- all the
-
specific libraries that need Shuttle replacements, following the
shuttle-tokiopattern designed by @sarsko- tokio, tokio-stream (Add shuttle-tokio #238)
- parking-lot (Add shuttle-parking_lot #232)
- ...
-
main shuttle entry point
- re-export for convenience and backward compatibility