This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ----------------------------- MODULE RafDelivery ----------------------------- | |
| EXTENDS FiniteSets, Naturals | |
| VARIABLES raf_requested, tick_received | |
| CONSTANT N | |
| ---------------------------------------------------------------------------- | |
| Pipeline == 0..N | |
| TypeOk == /\ raf_requested \in [Pipeline -> BOOLEAN] | |
| /\ tick_received \in BOOLEAN | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ----------------------------- MODULE RafBroken ----------------------------- | |
| EXTENDS FiniteSets, Naturals | |
| VARIABLES raf_requested, tick_received | |
| CONSTANT N | |
| ---------------------------------------------------------------------------- | |
| Pipeline == 0..N | |
| TypeOk == /\ raf_requested \in [Pipeline -> BOOLEAN] | |
| /\ tick_received \in [Pipeline -> BOOLEAN] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ---------------------- MODULE RenderingUpdateBatching ---------------------- | |
| EXTENDS FiniteSets, Naturals | |
| VARIABLES task_queue, rendering_task_queued, closed | |
| CONSTANT N | |
| ---------------------------------------------------------------------------- | |
| Pipeline == 0..N | |
| TypeOk == /\ task_queue \in [Pipeline -> BOOLEAN] | |
| /\ rendering_task_queued \in [Pipeline -> BOOLEAN] | |
| /\ closed \in SUBSET Pipeline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ---------------------- MODULE RenderingUpdateBatchingBroken ---------------------- | |
| EXTENDS FiniteSets, Naturals | |
| VARIABLES task_queue, rendering_task_queued | |
| CONSTANT N | |
| ---------------------------------------------------------------------------- | |
| Pipeline == 0..N | |
| TypeOk == /\ task_queue \in [Pipeline -> BOOLEAN] | |
| /\ rendering_task_queued \in BOOLEAN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ----------------------------- MODULE FGEventLoop --------------------------- | |
| EXTENDS FiniteSets, Naturals | |
| VARIABLES task_state, step_state | |
| CONSTANT N | |
| ---------------------------------------------------------------------------- | |
| Count == 0..N | |
| Task == {"Other", "Update"} | |
| Step == {"A", "B"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ----------------------------- MODULE EventLoop ----------------------------- | |
| EXTENDS FiniteSets, Naturals | |
| VARIABLES task_counter, step_counter | |
| CONSTANT N | |
| ---------------------------------------------------------------------------- | |
| Count == 0..N | |
| Task == {"Other", "Update"} | |
| Step == {"A", "B"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ----------------------------- MODULE EventLoop ----------------------------- | |
| EXTENDS FiniteSets, Naturals | |
| VARIABLES task_counter, step_counter | |
| CONSTANT N | |
| ---------------------------------------------------------------------------- | |
| Count == 0..N | |
| Task == {"One", "Two"} | |
| Step == {"A", "B"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// Implementation of the algorithm described at | |
| /// https://lamport.azurewebsites.net/pubs/teaching-concurrency.pdf | |
| use std::collections::HashMap; | |
| use std::sync::{Arc, Mutex}; | |
| #[derive(Eq, PartialEq, Hash, Clone)] | |
| struct ProcessId(i32); | |
| #[derive(Debug, Clone)] | |
| enum Value { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ------------------------ MODULE TeachingConcurrency ------------------------ | |
| EXTENDS FiniteSets, Naturals | |
| VARIABLES x, y | |
| CONSTANT N, NoVal | |
| ---------------------------------------------------------------------------- | |
| \* Specification based on "Teaching Concurrency" | |
| \* found at https://lamport.azurewebsites.net/pubs/teaching-concurrency.pdf | |
| Process == 0..(N - 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum Consensus { | |
| MultiPaxos(Vec<Arc<Mutex<Synod>>>), | |
| ViewStampedReplication(Arc<Mutex<VsrState>>) | |
| } |